Text  |   XML   |   Visible Warnings:

irssi-0.8.14 : irssi-0.8.14 analysis 2 : Null Pointer Dereference  at fe-help.c:92

Categories: LANG.MEM.NPD CWE:476
Warning ID: 7310.28402
Procedure: help_category
Trace: view
Modified: Thu Nov 26 11:09: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
   /kat0/fletcher/SATE/2010/irssi-0.8.14/src/fe-common/core/fe-help.c
   Enter help_category
 53 static void help_category(GSList *cmdlist, int items) 
 54 {
 55         WINDOW_REC *window;
 56         TEXT_DEST_REC dest;
 57         GString *str;
 58         GSList *tmp;
 59         int *columns, cols, rows, col, row, last_col_rows, max_width;
 60         char *linebuf, *format, *stripped;
 61  
 62         window = window_find_closest(NULL, NULL, MSGLEVEL_CLIENTCRAP);
 63         max_width = window->width;
 64  
 65         /* remove width of timestamp from max_width */ 
 66         format_create_dest(&dest, NULL, NULL, MSGLEVEL_CLIENTCRAP, NULL);
 67         format = format_get_line_start(current_theme, &dest, time(NULL));
 68         if (format != NULL) {
 69                 stripped = strip_codes(format);
 70                 max_width -= strlen(stripped);
 71                 g_free(stripped);
true72                 g_free(format);
 73         }
 74  
 75         /* calculate columns */ 
columns <= 409576         cols = get_max_column_count(cmdlist, get_cmd_length,
true77                                     max_width, 6, 1, 3, &columns, &rows);
 78         cmdlist = columns_sort_list(cmdlist, rows);
 79  
 80         /* rows in last column */ 
 81         last_col_rows = rows-(cols*rows-g_slist_length(cmdlist));
 82         if (last_col_rows == 0)
 83                 last_col_rows = rows;
 84  
 85         str = g_string_new(NULL);
 86         linebuf = g_malloc(max_width+1);
 87  
 88         col = 0; row = 0;
 89         for (tmp = cmdlist; tmp != NULL; tmp = tmp->next) {
 90                 COMMAND_REC *rec = tmp->data;
 91  
columns <= 409592                 memset(linebuf, ' ', columns[col]);     /* Null Pointer Dereference */
Preconditions
strlen(&$unknown_478673) = 0
Postconditions
strlen(&$unknown_478674)' = 0
col' = 0
cols' = 0
columns' = 0
dest.level' = 524288
dest.server' = 0
dest.target' = 0
format' = &$unknown_478673
last_col_rows' = 0
max_width' = ((char*)windows->data)[8]
row' = 0
rows' = 0
stripped' = &$unknown_478674
tmp' = cmdlist
window' = windows->data




Change Warning 7310.28402 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: