Text  |   XML   |   Visible Warnings:

Irssi : Irssi analysis 1 : Negative file descriptor  at rawlog.c:107

Categories: POSIX.IO.NEGFD
Warning ID: 2134.2136
Procedure: rawlog_dump
Trace: View
Modified: Wed Sep 2 11:51:27 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/core/rawlog.c
   Enter rawlog_save
 140 void rawlog_save(RAWLOG_REC *rawlog, const char *fname) 
 141 {
 142         char *path;
 143         int f;
 144  
 145         path = convert_home(fname);
true146         f = open(path, O_WRONLY | O_APPEND | O_CREAT, log_file_create_mode);
 147         g_free(path);
 148  
f <= -1149         rawlog_dump(rawlog, f);
     Enter rawlog_save / rawlog_dump
$param_2 <= -1102   static void rawlog_dump(RAWLOG_REC *rawlog, int f) 
 103   {
 104           GSList *tmp;
 105    
 106           for (tmp = rawlog->lines; tmp != NULL; tmp = tmp->next) {   /* Null Pointer Dereference (ID: 2313.2322) */
f <= -1107                   write(f, tmp->data, strlen((char *) tmp->data));     /* Negative file descriptor */  /* 2 more... */
     Exit rawlog_save / rawlog_dump
Preconditions
((char*)$param_2)[1] <= 47
((char*)$param_2)[1] >= 0
*$param_2 = 126
strlen($param_2) != 0
Postconditions
$unknown_183549' is opened
errno' != 0
f' = -1
f' = -1
fname' = $param_2
path' = &$unknown_183549
rawlog' = $param_1
rawlog' = $param_1
tmp' = ((char*)$param_1)[16]




Change Warning 2134.2136 : Negative file descriptor

Priority:
State:
Finding:
Owner:
Note: