Skip to content

Commit 1b958bd

Browse files
author
neal.norwitz
committed
SF #1701207, Fix bogus assertion (and test it!)
git-svn-id: http://svn.python.org/projects/python/trunk@54841 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 3d88116 commit 1b958bd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Python/sysmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -997,8 +997,6 @@ svnversion_init(void)
997997
}
998998
else if (istag || strncmp(br_start, "branches", 8) == 0) {
999999
len = br_end2 - br_start;
1000-
assert(len >= 13);
1001-
assert(len < (sizeof(patchlevel_revision) - 13));
10021000
strncpy(branch, br_start, len);
10031001
branch[len] = '\0';
10041002

@@ -1017,6 +1015,8 @@ svnversion_init(void)
10171015
svn_revision = svnversion;
10181016
else if (istag) {
10191017
len = strlen(_patchlevel_revision);
1018+
assert(len >= 13);
1019+
assert(len < (sizeof(patchlevel_revision) + 13));
10201020
strncpy(patchlevel_revision, _patchlevel_revision + 11,
10211021
len - 13);
10221022
patchlevel_revision[len - 13] = '\0';

0 commit comments

Comments
 (0)