svn commit: trunk/busybox/archival

vda at busybox.net vda at busybox.net
Sat Sep 30 21:05:26 UTC 2006


Author: vda
Date: 2006-09-30 14:05:25 -0700 (Sat, 30 Sep 2006)
New Revision: 16277

Log:
dpkg: fix use-after-free (bug 939)


Modified:
   trunk/busybox/archival/dpkg.c


Changeset:
Modified: trunk/busybox/archival/dpkg.c
===================================================================
--- trunk/busybox/archival/dpkg.c	2006-09-30 20:41:44 UTC (rev 16276)
+++ trunk/busybox/archival/dpkg.c	2006-09-30 21:05:25 UTC (rev 16277)
@@ -304,16 +304,13 @@
 		deb_ver2++;
 	}
 	result = version_compare_part(upstream_ver1, upstream_ver2);
+	if (!result)
+		/* Compare debian versions */
+		result = version_compare_part(deb_ver1, deb_ver2);
 
 	free(upstream_ver1);
 	free(upstream_ver2);
-
-	if (result != 0) {
-		return result;
-	}
-
-	/* Compare debian versions */
-	return version_compare_part(deb_ver1, deb_ver2);
+	return result;
 }
 
 static int test_version(const unsigned int version1, const unsigned int version2, const unsigned int operator)




More information about the busybox-cvs mailing list