Mercurial > cpython-lru_cache-weakref
diff Python/sysmodule.c @ 41470:31c92828aefb legacy-trunk
SF #1701207, Fix bogus assertion (and test it!)
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Mon, 16 Apr 2007 07:37:55 +0000 |
| parents | 86ab2f20a333 |
| children | d44fffda2cd0 |
line wrap: on
line diff
--- a/Python/sysmodule.c Sat Apr 14 05:25:50 2007 +0000 +++ b/Python/sysmodule.c Mon Apr 16 07:37:55 2007 +0000 @@ -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';
