[Midnightbsd-cvs] src [7743] stable/0.8/lib/libmport/bundle_read_install_pkg.c: fix a bug where mode is not initialized by allowing NULL for data again.

root at midnightbsd.org root at midnightbsd.org
Mon Aug 15 07:40:07 EDT 2016


Revision: 7743
          http://svnweb.midnightbsd.org/src/?rev=7743
Author:   root
Date:     2016-08-15 07:40:03 -0400 (Mon, 15 Aug 2016)
Log Message:
-----------
fix a bug where mode is not initialized by allowing NULL for data again.

Modified Paths:
--------------
    stable/0.8/lib/libmport/bundle_read_install_pkg.c

Modified: stable/0.8/lib/libmport/bundle_read_install_pkg.c
===================================================================
--- stable/0.8/lib/libmport/bundle_read_install_pkg.c	2016-08-15 03:16:50 UTC (rev 7742)
+++ stable/0.8/lib/libmport/bundle_read_install_pkg.c	2016-08-15 11:40:03 UTC (rev 7743)
@@ -301,11 +301,7 @@
 			const unsigned char *group = sqlite3_column_text(stmt, 4);
 			const unsigned char *mode = sqlite3_column_text(stmt, 5);
 
-			if (data == NULL) {
-				e->data = strdup(""); /* needs to be empty string */	
-			} else {
-				e->data = strdup((char *) data);
-			}
+			e->data = data == NULL ? NULL : strdup((char *) data);
 			if (checksum != NULL)
 				e->checksum = strdup((char *) checksum);
 			if (owner != NULL)



More information about the Midnightbsd-cvs mailing list