comparison src/context.cpp @ 195:797299e9fffc stable-6-0-15

fix null dereference if missing _ macro
author carl
date Fri, 07 Dec 2007 16:59:41 -0800
parents 8f4a9a37d4d9
children 92a5c866bdfa
comparison
equal deleted inserted replaced
194:688ec12a3c0c 195:797299e9fffc
484 for (autowhite_sent::iterator i=rcpts.begin(); i!=rcpts.end();) { 484 for (autowhite_sent::iterator i=rcpts.begin(); i!=rcpts.end();) {
485 time_t when = (*i).second; 485 time_t when = (*i).second;
486 if (when < limit) { 486 if (when < limit) {
487 char *who = (*i).first; 487 char *who = (*i).first;
488 free(who); 488 free(who);
489 autowhite_sent::iterator j = i; 489 rcpts.erase(i++);
490 j++;
491 rcpts.erase(i);
492 i = j;
493 need = true; 490 need = true;
494 } 491 }
495 else i++; 492 else i++;
496 } 493 }
497 494
754 } 751 }
755 752
756 753
757 char *CONTEXT::generic_match(char *client) 754 char *CONTEXT::generic_match(char *client)
758 { 755 {
756 if (!client) return NULL; // allow missing _ macro, which will disable generic checking
759 if (parent && !generic_regx) return parent->generic_match(client); 757 if (parent && !generic_regx) return parent->generic_match(client);
760 if (!generic_regx) return NULL; 758 if (!generic_regx) return NULL;
761 if (0 == regexec(&generic_pattern, client, 0, NULL, 0)) { 759 if (0 == regexec(&generic_pattern, client, 0, NULL, 0)) {
762 return generic_message; 760 return generic_message;
763 } 761 }