Browse code

sigopts: fixed incorrect checks for AC_WORD_MARKER_RIGHT

Kevin Lin authored on 2015/06/09 05:20:36
Showing 1 changed files
... ...
@@ -1110,12 +1110,12 @@ static int ac_findmatch_branch(const unsigned char *buffer, uint32_t offset, uin
1110 1110
             if(bp == length)
1111 1111
                 match = !match;
1112 1112
             /* 'wide' characters need a 'wider' check */
1113
-            else if(pattern->sigopts & ACPATT_OPTION_WIDE) {
1113
+            else if((pattern->sigopts & ACPATT_OPTION_WIDE) && (bp+1 < length)) {
1114 1114
                 if(!(isalnum(buffer[bp]) && buffer[bp + 1] == '\0'))
1115 1115
                     match = !match;
1116 1116
             }
1117 1117
             /* 'normal' characters */
1118
-            else if(!isalnum(buffer[offset - 1]))
1118
+            else if(!isalnum(buffer[bp]))
1119 1119
                 match = !match;
1120 1120
         }
1121 1121