Text  |   XML   |   Visible Warnings:

irssi-0.8.14 : irssi-0.8.14 analysis 2 : Null Test After Dereference  at misc.c:506

Categories: LANG.STRUCT.NTAD
Warning ID: 4753.28232
Procedure: match_wildcards
Trace: view
Modified: Thu Nov 26 11:08:12 2009   show details
 
Priority: None
State: None
Finding: None
Owner: None
  edit properties

Legend [ X ]
Warning Location
Contributes
Parse Error
Other Warning
Two or More Loop Iterations
On Execution Path
Comment
Macro
Preprocessor
Include
Keyword
Preprocessed Away

Source  |  Language: C Hide Legend     
LineSource
  /kat0/fletcher/SATE/2010/irssi-0.8.14/src/core/misc.c
  Enter match_wildcards
473 int match_wildcards(const char *cmask, const char *data) 
474 {
475         char *mask, *newmask, *p1, *p2;
476         int ret;
477  
478         newmask = mask = g_strdup(cmask);
479         for (; *mask != '\0' && *data != '\0'; mask++) {
480                 if (*mask != '*') {
481                         if (*mask != '?' && i_toupper(*mask) != i_toupper(*data))
482                                 break;
483  
484                         data++;
485                         continue;
486                 }
487  
488                 while (*mask == '?' || *mask == '*') mask++;
489                 if (*mask == '\0') {
490                         data += strlen(data);
491                         break;
492                 }
493  
494                 p1 = strchr(mask, '*');
495                 p2 = strchr(mask, '?');
496                 if (p1 == NULL || (p2 < p1 && p2 != NULL)) p1 = p2;
497  
498                 if (p1 != NULL) *p1 = '\0';
499  
500                 data = stristr(data, mask);
501                 if (data == NULL) break;
502  
503                 data += strlen(mask);
504                 mask += strlen(mask)-1;
505  
506                 if (p1 != NULL) *p1 = p1 == p2 ? '?' : '*';     /* Null Test After Dereference */
507         }
508  
509         while (*mask == '*') mask++;
510  
511         ret = data != NULL && *data == '\0' && *mask == '\0';
512         g_free(newmask);
513  
514         return ret;
515 } 




Change Warning 4753.28232 : Null Test After Dereference

Priority:
State:
Finding:
Owner:
Note: