From 44247a8743d92b99c86e73851aad0416135b418f Mon Sep 17 00:00:00 2001 From: Zdenek Styblik Date: Wed, 22 May 2013 10:05:06 +0000 Subject: [PATCH] ID: 3522740 - reading password from file is limited to 16byte passwords Reading password from file is no longer limited to 16bytes. Reported-by: Dune Idaho --- ipmitool/lib/ipmi_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ipmitool/lib/ipmi_main.c b/ipmitool/lib/ipmi_main.c index b8da60d..5d22c09 100644 --- a/ipmitool/lib/ipmi_main.c +++ b/ipmitool/lib/ipmi_main.c @@ -101,12 +101,13 @@ ipmi_password_file_read(char * filename) char * pass = NULL; int l; - pass = malloc(16); + pass = malloc(21); if (pass == NULL) { lprintf(LOG_ERR, "ipmitool: malloc failure"); return NULL; } + memset(pass, 21, 0); fp = ipmi_open_file_read((const char *)filename); if (fp == NULL) { lprintf(LOG_ERR, "Unable to open password file %s", @@ -115,7 +116,7 @@ ipmi_password_file_read(char * filename) } /* read in id */ - if (fgets(pass, 16, fp) == NULL) { + if (fgets(pass, 21, fp) == NULL) { lprintf(LOG_ERR, "Unable to read password from file %s", filename); fclose(fp);