Text  |   XML   |   Visible Warnings:

irssi-0.8.14 : irssi-0.8.14 analysis 2 : Null Pointer Dereference  at perl-common.c:530

Categories: LANG.MEM.NPD CWE:476
Warning ID: 7356.28453
Procedure: remove_newlines
Trace: view
Modified: Thu Nov 26 11:10:01 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     
ProblemLineSource
   /kat0/fletcher/SATE/2010/irssi-0.8.14/src/perl/perl-common.c
   Enter perl_command
 536 void perl_command(const char *cmd, SERVER_REC *server, WI_ITEM_REC *item) 
 537 {
 538         const char *cmdchars;
 539         char *sendcmd = (char *) cmd;
 540  
 541         if (*cmd == '\0')
 542                 return;
 543  
 544         cmdchars = settings_get_str("cmdchars");
 545         if (strchr(cmdchars, *cmd) == NULL) {   /* Null Pointer Dereference (ID: 7357.28454) */
 546                 /* no command char - let's put it there.. */ 
 547                 sendcmd = g_strdup_printf("%c%s", *cmdchars, cmd);
 548         }
 549  
 550         /* remove \r and \n from commands,
 551            to make it harder to introduce a security bug in a script */ 
 552         if(strpbrk(sendcmd, "\r\n")) {
 553                 if (sendcmd == cmd)
true554                         sendcmd = strdup(cmd);
sendcmd <= 4095555                 remove_newlines(sendcmd);
     Enter perl_command / remove_newlines
 526   static void remove_newlines(char *str) 
 527   {
 528           char *writing = str;
 529    
str <= 4095530           for (;*str;str++)     /* Null Pointer Dereference */
     Exit perl_command / remove_newlines
Preconditions
&$unknown_684016 = str
&$unknown_684017 != 0
*str != 0
strlen(str) > 0
$unknown_684015 != *str
$unknown_684016 != 0
strlen(&$unknown_684016) != 0
Postconditions
cmdchars' = &$unknown_684015
errno' != 0
sendcmd' = 0
str' = 0
writing' = 0




Change Warning 7356.28453 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: