/[pcre]/code/trunk/pcre_dfa_exec.c
ViewVC logotype

Diff of /code/trunk/pcre_dfa_exec.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 553 by ph10, Fri Oct 22 15:57:50 2010 UTC revision 567 by ph10, Sat Nov 6 17:10:00 2010 UTC
# Line 2844  if (re == NULL || subject == NULL || wor Line 2844  if (re == NULL || subject == NULL || wor
2844     (offsets == NULL && offsetcount > 0)) return PCRE_ERROR_NULL;     (offsets == NULL && offsetcount > 0)) return PCRE_ERROR_NULL;
2845  if (offsetcount < 0) return PCRE_ERROR_BADCOUNT;  if (offsetcount < 0) return PCRE_ERROR_BADCOUNT;
2846  if (wscount < 20) return PCRE_ERROR_DFA_WSSIZE;  if (wscount < 20) return PCRE_ERROR_DFA_WSSIZE;
2847    if (start_offset < 0 || start_offset > length) return PCRE_ERROR_BADOFFSET;
2848    
2849  /* We need to find the pointer to any study data before we test for byte  /* We need to find the pointer to any study data before we test for byte
2850  flipping, so we scan the extra_data block first. This may set two fields in the  flipping, so we scan the extra_data block first. This may set two fields in the
# Line 2966  if (utf8 && (options & PCRE_NO_UTF8_CHEC Line 2967  if (utf8 && (options & PCRE_NO_UTF8_CHEC
2967      return PCRE_ERROR_BADUTF8;      return PCRE_ERROR_BADUTF8;
2968    if (start_offset > 0 && start_offset < length)    if (start_offset > 0 && start_offset < length)
2969      {      {
2970      int tb = ((uschar *)subject)[start_offset];      int tb = ((USPTR)subject)[start_offset] & 0xc0;
2971      if (tb > 127)      if (tb == 0x80) return PCRE_ERROR_BADUTF8_OFFSET;
       {  
       tb &= 0xc0;  
       if (tb != 0 && tb != 0xc0) return PCRE_ERROR_BADUTF8_OFFSET;  
       }  
2972      }      }
2973    }    }
2974  #endif  #endif

Legend:
Removed from v.553  
changed lines
  Added in v.567

  ViewVC Help
Powered by ViewVC 1.1.5