diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-04-16 07:37:55 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-04-16 07:37:55 (GMT) |
commit | 68cdf8a6da89c22f333444bbd76a73113bdcfa20 (patch) | |
tree | 91c01c6ab2564bcf6b139897c1e14b58fc18df32 /Python/sysmodule.c | |
parent | cbd9ee69eeaadf7a50007532071890b4eaeae664 (diff) | |
download | cpython-68cdf8a6da89c22f333444bbd76a73113bdcfa20.zip cpython-68cdf8a6da89c22f333444bbd76a73113bdcfa20.tar.gz cpython-68cdf8a6da89c22f333444bbd76a73113bdcfa20.tar.bz2 |
SF #1701207, Fix bogus assertion (and test it!)
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 59f6cfc..774a7db 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -997,8 +997,6 @@ svnversion_init(void) } 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 @@ svnversion_init(void) 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'; |