Change 32983 by [EMAIL PROTECTED] on 2008/01/16 14:41:22

        Reverse change 26510 as various existing modules rely on this bug:
        
        Change 26510 by [EMAIL PROTECTED] on 2005/12/28 11:01:46
        
        Remove test for NUL ending in r?instr().
        This test is actually harmful because we will search
        for any garbage found past the empty search string.
        Ref change 26509.

Affected files ...

... //depot/maint-5.8/perl/util.c#159 edit

Differences ...

==== //depot/maint-5.8/perl/util.c#159 (text) ====
Index: perl/util.c
--- perl/util.c#158~32528~      2007-11-28 04:54:17.000000000 -0800
+++ perl/util.c 2008-01-16 06:41:22.000000000 -0800
@@ -419,7 +419,9 @@
 Perl_ninstr(pTHX_ const char *big, const char *bigend, const char *little, 
const char *lend)
 {
     PERL_UNUSED_CONTEXT;
-    if (little >= lend)
+    if (!*little && /* This re-instates the bug fixed by change 26510, which
+                    Compress::Zlib 1.42 (among others) relies on.  */
+       little >= lend)
         return (char*)big;
     {
         char first = *little++;
@@ -449,7 +451,7 @@
     register const char * const littleend = lend;
     PERL_UNUSED_CONTEXT;
 
-    if (little >= littleend)
+    if (!first && little >= littleend)
        return (char*)bigend;
     bigbeg = big;
     big = bigend - (littleend - little++);
End of Patch.

Reply via email to