[Python-checkins] python/dist/src/Misc NEWS,1.515,1.516

niemeyer@users.sourceforge.net niemeyer@users.sourceforge.net
Wed, 06 Nov 2002 19:28:58 -0800


Update of /cvsroot/python/python/dist/src/Misc
In directory usw-pr-cvs1:/tmp/cvs-serv8064/Misc

Modified Files:
	NEWS 
Log Message:
Fixed sre bug "[#581080] Provoking infinite scanner loops".

This bug happened because: 1) the scanner_search and scanner_match methods
were not checking the buffer limits before increasing the current pointer;
and 2) SRE_SEARCH was using "if (ptr == end)" as a loop break, instead of
"if (ptr >= end)".

* Modules/_sre.c
  (SRE_SEARCH): Check for "ptr >= end" to break loops, so that we don't
  hang forever if a pointer passing the buffer limit is used.
  (scanner_search,scanner_match): Don't increment the current pointer
  if we're going to pass the buffer limit.

* Misc/NEWS
  Mention the fix.


Index: NEWS
===================================================================
RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v
retrieving revision 1.515
retrieving revision 1.516
diff -C2 -d -r1.515 -r1.516
*** NEWS	6 Nov 2002 21:59:31 -0000	1.515
--- NEWS	7 Nov 2002 03:28:55 -0000	1.516
***************
*** 360,363 ****
--- 360,368 ----
    1, not 2.
  
+ - Fixed bug #581080: sre scanner was not checking the buffer limit
+   before increasing the current pointer. This was creating an infinite
+   loop in the search function, once the pointer exceeded the buffer
+   limit.
+ 
  Library
  -------