After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 740612 - Cups secret service auth_info lookup fails to read auth_info saved by system-config-printer
Cups secret service auth_info lookup fails to read auth_info saved by system-...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
3.15.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-11-24 10:05 UTC by Andre Heinecke
Modified: 2014-11-26 03:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to remove the faulty check (1.14 KB, patch)
2014-11-24 10:05 UTC, Andre Heinecke
none Details | Review
Patch to remove the faulty check (1.29 KB, patch)
2014-11-24 10:13 UTC, Andre Heinecke
committed Details | Review

Description Andre Heinecke 2014-11-24 10:05:17 UTC
Created attachment 291345 [details] [review]
Patch to remove the faulty check

This is a followup on Bug 674264. In our deployment we've noticed that GTK3 fails to read auth_info saved with system-config-printer.

This is due to a bad and overzealous check for an Invalid secret in gtkcupssecretutils to check if a password is zero terminated.

I originally added this check to avoid using a binary secret as a string, but this is uneccessary there and might even lead to an out of bounds memory access in case the password is really not zero terminated.

The g_strndup below this check ensures that the secret used later is zero terminated. The NULL pointer check there is also actually uneccessary but I still like to keep it to fail as early and clearly as possible.

The Password "test" stored by system-config-printer is provided by gnome-keyring with a len of 4 but a strlen on the pointer returns 6 (does not appear to be random so at least it does not crash). 

Please apply the attached patch.
Comment 1 Andre Heinecke 2014-11-24 10:13:27 UTC
Created attachment 291346 [details] [review]
Patch to remove the faulty check

Removed the following comment and clarified the debug output.