*** gnats/ChangeLog Fri Dec 12 13:18:39 1997 --- gnats/ChangeLog Fri Dec 12 13:19:07 1997 *************** *** 1,3 **** --- 1,9 ---- + Sun Dec 7 20:33:20 1997 Karl Fogel + + * file-pr.c (check_if_reply): don't file if category in Subject + header is not a valid category (this helps prevent spurious + matches, for example "Re: OS/2 release"). + Fri Dec 5 13:43:20 1997 Karl Fogel * files.c (free_responsible): if `alias' lives in borrowed space *** gnats/file-pr.c Fri Dec 12 13:14:02 1997 --- gnats/file-pr.c Fri Dec 12 13:19:08 1997 *************** *** 374,383 **** char token[STR_MAX]; char *path; struct stat buf; ! char *s, *c; struct re_pattern_buffer regex; struct re_registers regs; ! int i, start, end; char *case_fold; s = header_value (SUBJECT); --- 374,384 ---- char token[STR_MAX]; char *path; struct stat buf; ! Category cat; ! char *s, *c, *cat_name; struct re_pattern_buffer regex; struct re_registers regs; ! int i, start, end, res; char *case_fold; s = header_value (SUBJECT); *************** *** 416,422 **** c = strchr (s + start, '/'); if (c) ! path = get_category (c + 1); else { path = xmalloc (PATH_MAX); --- 417,451 ---- c = strchr (s + start, '/'); if (c) ! { ! /* The category's name is what comes before the '/'. */ ! cat_name = s + start; ! ! /* Terminate it temporarily: */ ! *c = '\0'; ! ! /* Void cat just in case free_category() expects NULLs. */ ! memset ((void *) &cat, 0, sizeof (Category)); ! ! /* See if the category exists: */ ! res = find_category (&cat, cat_name); ! ! /* Undo temporary terminator: */ ! *c = '/'; ! ! /* If no such category, then this is not a reply to a valid ! * problem report. This situtation can arise, for example, when ! * someone has the string "OS/2" in their Subject header. ! */ ! if (res == -1) ! return NULL; ! else ! { ! /* We only needed res, never cat, so free cat. */ ! free_category (&cat); ! path = get_category (c + 1); ! } ! } else { path = xmalloc (PATH_MAX);