Task #52346 - added.err

back to task #52346
download
Error: COMPILER_WARNING (CWE-563):
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c:106:12: warning[-Wunused-variable]: unused variable 'l'
#  106 |     GList *l;
#      |            ^
#  104|   get_governors(cpufreq *cf){
#  105|       FILE *fp;
#  106|->     GList *l;
#  107|       char buf[ 100 ], sstmp [ 256 ], c, bufl = 0;
#  108|   

Error: COMPILER_WARNING:
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c: scope_hint: In function 'get_governors'
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c:118:38: warning[-Wformat=]: format '%s' expects argument of type 'char *', but argument 4 has type 'gpointer' {aka 'void *'}
#  118 |     snprintf(sstmp, sizeof(sstmp), "%s/%s", cf->cpus->data, SCALING_AGOV);
#      |                                     ~^      ~~~~~~~~~~~~~~
#      |                                      |              |
#      |                                      char *         gpointer {aka void *}
#      |                                     %p
#  116|           return;
#  117|       }
#  118|->     snprintf(sstmp, sizeof(sstmp), "%s/%s", cf->cpus->data, SCALING_AGOV);
#  119|   
#  120|       if (!(fp = fopen( sstmp, "r"))) {

Error: COMPILER_WARNING (CWE-823):
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c:128:20: warning[-Wchar-subscripts]: array subscript has type 'char'
#  128 |                 buf[bufl] = '\0';
#      |                    ^
#  126|           if(c == ' '){
#  127|               if(bufl > 1){
#  128|->                 buf[bufl] = '\0';
#  129|                   cf->governors = g_list_append(cf->governors, strdup(buf));
#  130|               }

Error: COMPILER_WARNING (CWE-823):
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c:134:21: warning[-Wchar-subscripts]: array subscript has type 'char'
#  134 |             buf[bufl++] = c;
#      |                 ~~~~^~
#  132|               buf[0] = '\0';
#  133|           }else{
#  134|->             buf[bufl++] = c;
#  135|           }
#  136|       }

Error: COMPILER_WARNING:
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c: scope_hint: In function 'permission'
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c:186:36: warning[-Wformat=]: format '%s' expects argument of type 'char *', but argument 4 has type 'gpointer' {aka 'void *'}
#  186 |     snprintf(path, sizeof(path), "%s/%s", cf->cpus->data, file);
#      |                                   ~^      ~~~~~~~~~~~~~~
#      |                                    |              |
#      |                                    char *         gpointer {aka void *}
#      |                                   %p
#  184|       char path [ 256 ];
#  185|   
#  186|->     snprintf(path, sizeof(path), "%s/%s", cf->cpus->data, file);
#  187|       return (g_access(path, W_OK) == 0);
#  188|   }

Error: COMPILER_WARNING:
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c: scope_hint: In function 'frequency_menu'
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c:196:38: warning[-Wformat=]: format '%s' expects argument of type 'char *', but argument 4 has type 'gpointer' {aka 'void *'}
#  196 |     snprintf(sstmp, sizeof(sstmp), "%s/%s", cf->cpus->data, SCALING_AFREQ);
#      |                                     ~^      ~~~~~~~~~~~~~~
#      |                                      |              |
#      |                                      char *         gpointer {aka void *}
#      |                                     %p
#  194|       char buf[ 100 ], sstmp [ 256 ], c, bufl = 0;
#  195|   
#  196|->     snprintf(sstmp, sizeof(sstmp), "%s/%s", cf->cpus->data, SCALING_AFREQ);
#  197|   
#  198|       if (!(fp = fopen( sstmp, "r"))) {

Error: COMPILER_WARNING (CWE-823):
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c:209:20: warning[-Wchar-subscripts]: array subscript has type 'char'
#  209 |                 buf[bufl] = '\0';
#      |                    ^
#  207|           if(c == ' '){
#  208|               if(bufl > 1){
#  209|->                 buf[bufl] = '\0';
#  210|                   menuitem = gtk_menu_item_new_with_label(strdup(buf));
#  211|                   gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);

Error: GCC_ANALYZER_WARNING (CWE-401):
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c:211:17: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(&buf)'
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c:330:1: enter_function: entry to 'clicked'
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c:338:23: call_function: calling 'cpufreq_menu' from 'clicked'
#  209|                   buf[bufl] = '\0';
#  210|                   menuitem = gtk_menu_item_new_with_label(strdup(buf));
#  211|->                 gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
#  212|                   gtk_widget_show (menuitem);
#  213|                   param = g_new0(Param, 1);

Error: COMPILER_WARNING (CWE-823):
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c:222:21: warning[-Wchar-subscripts]: array subscript has type 'char'
#  222 |             buf[bufl++] = c;
#      |                 ~~~~^~
#  220|               buf[0] = '\0';
#  221|           }else{
#  222|->             buf[bufl++] = c;
#  223|           }
#  224|       }

Error: COMPILER_WARNING (CWE-563):
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c:270:13: warning[-Wunused-but-set-variable]: variable 'group' set but not used
#  270 |     GSList *group;
#      |             ^~~~~
#  268|   cpufreq_menu(cpufreq *cf){
#  269|       GList *l;
#  270|->     GSList *group;
#  271|       gboolean can_write;
#  272|       char buff[100];

Error: COMPILER_WARNING:
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c: scope_hint: In function 'cpufreq_menu'
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c:307:43: warning[-Wformat=]: format '%s' expects argument of type 'char *', but argument 4 has type 'gpointer' {aka 'void *'}
#  307 |         snprintf(buff, sizeof(buff), "▸  %s", l->data);
#      |                                          ~^   ~~~~~~~
#      |                                           |    |
#      |                                           |    gpointer {aka void *}
#      |                                           char *
#      |                                          %p
#  305|       {
#  306|         if(strcmp((char*)l->data, cf->cur_governor) == 0){
#  307|->         snprintf(buff, sizeof(buff), "▸  %s", l->data);
#  308|           menuitem = GTK_MENU_ITEM(gtk_menu_item_new_with_label(strdup(buff)));
#  309|         }else{

Error: GCC_ANALYZER_WARNING (CWE-401):
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c:308:20: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(&buff)'
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c:330:1: enter_function: entry to 'clicked'
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c:338:23: call_function: calling 'cpufreq_menu' from 'clicked'
#  306|         if(strcmp((char*)l->data, cf->cur_governor) == 0){
#  307|           snprintf(buff, sizeof(buff), "▸  %s", l->data);
#  308|->         menuitem = GTK_MENU_ITEM(gtk_menu_item_new_with_label(strdup(buff)));
#  309|         }else{
#  310|           snprintf(buff, sizeof(buff), "   %s", l->data);

Error: COMPILER_WARNING:
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c:310:43: warning[-Wformat=]: format '%s' expects argument of type 'char *', but argument 4 has type 'gpointer' {aka 'void *'}
#  310 |         snprintf(buff, sizeof(buff), "   %s", l->data);
#      |                                          ~^   ~~~~~~~
#      |                                           |    |
#      |                                           |    gpointer {aka void *}
#      |                                           char *
#      |                                          %p
#  308|           menuitem = GTK_MENU_ITEM(gtk_menu_item_new_with_label(strdup(buff)));
#  309|         }else{
#  310|->         snprintf(buff, sizeof(buff), "   %s", l->data);
#  311|           menuitem = GTK_MENU_ITEM(gtk_menu_item_new_with_label(strdup(buff)));
#  312|         }

Error: GCC_ANALYZER_WARNING (CWE-401):
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c:311:20: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(&buff)'
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c:330:1: enter_function: entry to 'clicked'
lxpanel-0.11.1/lxpanel/plugins/cpufreq/cpufreq.c:338:23: call_function: calling 'cpufreq_menu' from 'clicked'
#  309|         }else{
#  310|           snprintf(buff, sizeof(buff), "   %s", l->data);
#  311|->         menuitem = GTK_MENU_ITEM(gtk_menu_item_new_with_label(strdup(buff)));
#  312|         }
#  313|