Text  |   XML   |   Visible Warnings:

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

Categories: POSIX.IO.NEGFD
Warning ID: 2091.2092
Procedure: rawlog_dump
Trace: View
Modified: Wed Sep 2 11:51:09 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_open
 112 void rawlog_open(RAWLOG_REC *rawlog, const char *fname) 
 113 {
 114         char *path;
 115  
 116         g_return_if_fail(rawlog != NULL);
 117         g_return_if_fail(fname != NULL);
 118  
 119         if (rawlog->logging)
 120                 return;
 121  
 122         path = convert_home(fname);
 123         rawlog->handle = open(path, O_WRONLY | O_APPEND | O_CREAT,
true124                               log_file_create_mode);
 125         g_free(path);
 126  
rawlog->handle <= -1127         rawlog_dump(rawlog, rawlog->handle);
     Enter rawlog_open / 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_open / rawlog_dump
Preconditions
((char*)$param_2)[1] <= 47
((char*)$param_2)[1] >= 0
*$param_1 = 0
*$param_2 = 126
strlen($param_2) != 0
Postconditions
_g_boolean_var_' = 1
_g_boolean_var_' = 1
$unknown_57935' is opened
errno' != 0
f' = -1
fname' = $param_2
path' = &$unknown_57935
rawlog' = $param_1
rawlog' = $param_1
tmp' = ((char*)$param_1)[16]




Change Warning 2091.2092 : Negative file descriptor

Priority:
State:
Finding:
Owner:
Note: