! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Fix uninitialized value in thunar-chooser-dialog.c
Status:
RESOLVED: FIXED

Comments

Description Mario Rugiero 2014-05-06 13:06:52 CEST
Created attachment 5477 
Patch fixing the issue described.

In function thunar_chooser_dialog_response, if gtk_expander_get_expanded (GTK_EXPANDER (dialog->custom_expander) and gtk_tree_selection_get_selected (selection, &model, &iter) are false, app_info will not be initialized, which means it could later randomly pass a check for it being NULL while not holding a valid value. I found it with cppcheck, and attach a simple fix.
Comment 1 Eric Koegel editbugs 2014-11-02 10:35:14 CET
While reviewing some thunar patches on #xfce-dev, this one came up. This was a suggested change to your patch:
 
<foutrelis> GAppInfo  *app_info = NULL; would work better I think
<foutrelis> no need to do it in a random else statement when it can be initialized when declared

Thanks for taking the time to write the patch! If you do update it, you can always post it as a git patch so it's easier for maintainers to commit upstream and give you proper credit for your work.
Comment 2 Harald Judt editbugs 2015-03-12 19:47:30 CET
Seems to have been fixed a while ago.

Bug #10871

Reported by:
Mario Rugiero
Reported on: 2014-05-06
Last modified on: 2015-03-12

People

Assignee:
Jannis Pohlmann
CC List:
3 users

Version

Version:
unspecified

Attachments

Patch fixing the issue described. (567 bytes, patch)
2014-05-06 13:06 CEST , Mario Rugiero
no flags

Additional information