summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2010-08-09 20:02:00 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2010-08-09 20:02:00 (GMT)
commit172e15fdd6605b87119cd79da67498809674e2c7 (patch)
tree870d24f432aba951cf5e1f783d93a436fc86973f /Objects
parent45c67c3efe27bf9ddc9d67484aa8464fccee2b1d (diff)
downloadcpython-172e15fdd6605b87119cd79da67498809674e2c7.zip
cpython-172e15fdd6605b87119cd79da67498809674e2c7.tar.gz
cpython-172e15fdd6605b87119cd79da67498809674e2c7.tar.bz2
Merged revisions 83833,83838-83839,83859,83878 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83833 | florent.xicluna | 2010-08-08 18:25:27 +0200 (dim., 08 août 2010) | 2 lines Add test case for the HTTPResponse being an iterable. Follow-up of issue #4608. ........ r83838 | florent.xicluna | 2010-08-08 20:03:44 +0200 (dim., 08 août 2010) | 2 lines Typo. ........ r83839 | florent.xicluna | 2010-08-08 20:06:13 +0200 (dim., 08 août 2010) | 2 lines Issue #7564: Skip test_ioctl if another process is attached to /dev/tty. ........ r83859 | florent.xicluna | 2010-08-09 00:07:16 +0200 (lun., 09 août 2010) | 2 lines Fix #8530: Prevent stringlib fastsearch from reading beyond the front of an array. ........ r83878 | florent.xicluna | 2010-08-09 10:29:08 +0200 (lun., 09 août 2010) | 1 line Merge the 2to3 script from /sandbox/trunk/2to3/2to3, revision 72867 (latest). ........
Diffstat (limited to 'Objects')
-rw-r--r--Objects/stringlib/fastsearch.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/stringlib/fastsearch.h b/Objects/stringlib/fastsearch.h
index 7525951..e231c58 100644
--- a/Objects/stringlib/fastsearch.h
+++ b/Objects/stringlib/fastsearch.h
@@ -140,13 +140,13 @@ fastsearch(const STRINGLIB_CHAR* s, Py_ssize_t n,
/* got a match! */
return i;
/* miss: check if previous character is part of pattern */
- if (!STRINGLIB_BLOOM(mask, s[i-1]))
+ if (i > 0 && !STRINGLIB_BLOOM(mask, s[i-1]))
i = i - m;
else
i = i - skip;
} else {
/* skip: check if previous character is part of pattern */
- if (!STRINGLIB_BLOOM(mask, s[i-1]))
+ if (i > 0 && !STRINGLIB_BLOOM(mask, s[i-1]))
i = i - m;
}
}