Text  |   XML   |   Visible Warnings:

Irssi : Irssi analysis 1 : Null Pointer Dereference  at rawlog.c:106

Categories: LANG.MEM.NPD CWE:476
Warning ID: 2313.2322
Procedure: rawlog_dump
Trace: View
Modified: Wed Sep 2 12:04:24 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
   /u1/paul/SATE/2010/c/irssi/irssi-0.8.14/src/perl/common/Rawlog.c
   Enter XS_Irssi__Rawlog_save
 215 XS(XS_Irssi__Rawlog_save) 
 216 {
 217 #ifdef dVAR 
 218     dVAR; dXSARGS;
 219 #else 
 220     dXSARGS; 
 221 #endif 
 222     if (items != 2)
 223        Perl_croak(aTHX_ "Usage: %s(%s)", "Irssi::Rawlog::save", "rawlog, fname");
 224     PERL_UNUSED_VAR(cv); /* -W */ 
 225     {
true226         Irssi__Rawlog   rawlog = irssi_ref_object(ST(0));
 227         char *  fname = (char *)SvPV_nolen(ST(1));
 228  
rawlog <= 4095229         rawlog_save(rawlog, fname);
     /u1/paul/SATE/2010/c/irssi/irssi-0.8.14/src/core/rawlog.c
     Enter XS_Irssi__Rawlog_save / rawlog_save
$param_1 <= 4095140   void rawlog_save(RAWLOG_REC *rawlog, const char *fname) 
 141   {
 142           char *path;
 143           int f;
 144    
 145           path = convert_home(fname);
 146           f = open(path, O_WRONLY | O_APPEND | O_CREAT, log_file_create_mode);
 147           g_free(path);
 148    
rawlog <= 4095149           rawlog_dump(rawlog, f);
       Enter XS_Irssi__Rawlog_save / rawlog_save / rawlog_dump
$param_1 <= 4095102     static void rawlog_dump(RAWLOG_REC *rawlog, int f) 
 103     {
 104             GSList *tmp;
 105      
rawlog <= 4095106             for (tmp = rawlog->lines; tmp != NULL; tmp = tmp->next) {     /* Null Pointer Dereference */
       Exit XS_Irssi__Rawlog_save / rawlog_save / rawlog_dump
     Exit XS_Irssi__Rawlog_save / rawlog_save
Postconditions
_svi' = &$unknown_1722672
$unknown_1722650' = $unknown_1722650 - 4
$unknown_1722677' is opened
cv' = $param_2
errno' != 0
f' = -1
f' = -1
fname' = ((char*)&$unknown_1722672)[16]
fname' = ((char*)&$unknown_1722672)[16]
items' != 2
my_perl' = $param_1
path' = &$unknown_1722677
rawlog' = 0
rawlog' = 0
rawlog' = 0




Change Warning 2313.2322 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: