[Python-checkins] r54841 - python/trunk/Python/sysmodule.c

neal.norwitz python-checkins at python.org
Mon Apr 16 09:37:57 CEST 2007


Author: neal.norwitz
Date: Mon Apr 16 09:37:55 2007
New Revision: 54841

Modified:
   python/trunk/Python/sysmodule.c
Log:
SF #1701207, Fix bogus assertion (and test it!)

Modified: python/trunk/Python/sysmodule.c
==============================================================================
--- python/trunk/Python/sysmodule.c	(original)
+++ python/trunk/Python/sysmodule.c	Mon Apr 16 09:37:55 2007
@@ -997,8 +997,6 @@
 	}
 	else if (istag || strncmp(br_start, "branches", 8) == 0) {
 		len = br_end2 - br_start;
-		assert(len >= 13);
-		assert(len < (sizeof(patchlevel_revision) - 13));
 		strncpy(branch, br_start, len);
 		branch[len] = '\0';
 
@@ -1017,6 +1015,8 @@
 		svn_revision = svnversion;
 	else if (istag) {
 		len = strlen(_patchlevel_revision);
+		assert(len >= 13);
+		assert(len < (sizeof(patchlevel_revision) + 13));
 		strncpy(patchlevel_revision, _patchlevel_revision + 11,
 			len - 13);
 		patchlevel_revision[len - 13] = '\0';


More information about the Python-checkins mailing list