Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PVS studio check #140

Open
shlyakpavel opened this issue Dec 16, 2018 · 2 comments
Open

PVS studio check #140

shlyakpavel opened this issue Dec 16, 2018 · 2 comments

Comments

@shlyakpavel
Copy link

shlyakpavel commented Dec 16, 2018

Hello. I have just examined the code with PVS studio static analyzer. The code is pretty clean. However, suspicious place was found:

if (!nt->has_timeout || (!screensaver_active (GTK_WIDGET (nw)) && !fullscreen_window_exists (GTK_WIDGET (nw))))
{
theme_show_notification (nw);
if (sound_file != NULL)
{
sound_play_file (GTK_WIDGET (nw), sound_file);
}
}
else
{
_NotifyPendingClose* data;
/* The notification was not shown, so queue up a close
* for it */
data = g_new0 (_NotifyPendingClose, 1);
data->id = id;
data->daemon = g_object_ref (daemon);
g_idle_add ((GSourceFunc) _close_notification_not_shown, data);
}
g_free (sound_file);
g_object_set_data (G_OBJECT (nw), "_notify_id", GUINT_TO_POINTER (return_id));
if (nt)

Pay attention to the line 1565 where nt pointer is first used and the line 1590 where it is checked against nullptr. Null pointer dereference is possible.
Thanks for providing us with stable and useful software!
Have a nice day :)


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@raveit65
Copy link
Member

raveit65 commented Aug 9, 2023

Pull request please.

@shlyakpavel
Copy link
Author

@raveit65 it may require extra investigation after 5 years
I'll check it later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants