]> granicus.if.org Git - python/commitdiff
Fix for bug #110651 (Jitterbug PR#343): only use the low 8 bits of an octal
authorAndrew M. Kuchling <amk@amk.ca>
Wed, 2 Aug 2000 13:41:18 +0000 (13:41 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Wed, 2 Aug 2000 13:41:18 +0000 (13:41 +0000)
escape, as documented in the comment for the check_escape() function

Modules/pypcre.c

index 11c7ce95527420665721cfc7559951d87d0d80d6..c6a14ec52813a27e04b4c3b006343c277bcfff68 100644 (file)
@@ -1032,7 +1032,7 @@ else
       for(c=0, i=0; ptr[i]!=0 && i<3; i++) 
        {
          if (( pcre_ctypes[ ptr[i] ] & ctype_odigit) != 0)
-           c = c * 8 + ptr[i]-'0';
+           c = (c * 8 + ptr[i]-'0') & 255;
          else
            break; /* Non-octal character--break out of the loop */
        }