Zdenek,

This is a separate bug-fix patch for the found issue:

> Also, I found several cases where "tmp_pass" string acquired from the
> "getpass()" call is incorrectly freed. The getpass() function returns
> address to a static buffer and freeing that address results in abrupt
> program termination. I removed these free() calls altogether.
>

Regards,
Dmitry
Index: lib/ipmi_main.c
===================================================================
--- lib/ipmi_main.c	(revision 1356)
+++ lib/ipmi_main.c	(working copy)
@@ -503,7 +506,6 @@
 					password = NULL;
 				}
 				password = strdup(tmp_pass);
-				free(tmp_pass);
 				tmp_pass = NULL;
 				if (password == NULL) {
 					lprintf(LOG_ERR, "%s: malloc failure", progname);
@@ -559,7 +561,6 @@
 					kgkey = NULL;
 				}
 				kgkey = strdup(tmp_pass);
-				free(tmp_pass);
 				tmp_pass = NULL;
 				if (kgkey == NULL) {
 					lprintf(LOG_ERR, "%s: malloc failure", progname);
@@ -793,7 +806,6 @@
 #endif
 		if (tmp_pass != NULL) {
 			password = strdup(tmp_pass);
-			free(tmp_pass);
 			tmp_pass = NULL;
 			if (password == NULL) {
 				lprintf(LOG_ERR, "%s: malloc failure", progname);
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

Reply via email to