Bug 53900

Summary: uninitialized variable error
Product: libfprint Reporter: Patrick Marlier <patrick.marlier>
Component: fprintdAssignee: libfprint-bugs
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: patch for trunk

Description Patrick Marlier 2012-08-22 00:03:00 UTC
Created attachment 65923 [details] [review]
patch for trunk

gdb ./tests/fprintd-verify

** (fprintd-verify:12901): CRITICAL **: dbus_set_g_error: assertion `gerror == NULL || *gerror == NULL' failed

Program received signal SIGSEGV, Segmentation fault.

#5  0x0000000000401125 in do_verify (dev=0x615a30) at ../../fprintd/tests/verify.c:145

144             if (!net_reactivated_Fprint_Device_verify_stop(dev, &error)) {
145                     g_print("VerifyStop failed: %s\n", error->message);
146                     exit (1);
147             }

(gdb) p error
$2 = (GError *) 0x6176d0
(gdb) p error->message
$3 = (gchar *) 0x14 <Address 0x14 out of bounds>

This is due to the uninitialized variable 'error'.
When initialized to NULL, I get the error message correctly.

Attached the fix (same for fprintd-enroll).
Thanks.
Comment 1 Bastien Nocera 2012-08-28 18:30:13 UTC
commit b80f7359c3b95f0b50c777f49d21cbdac41b9521
Author: Patrick Marlier <patrick.marlier@gmail.com>
Date:   Tue Aug 28 19:29:20 2012 +0100

    tests: Fix uninitialised variable use
    
    The GError was used without being initialised.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=53900
Comment 2 Patrick Marlier 2012-08-28 19:24:11 UTC
One part of the patch is missing into the commit (tests/enroll.c).
Thanks :)
Comment 3 Bastien Nocera 2012-08-28 21:11:41 UTC
Sorry, I only realised that there was a patch after committing it.

commit 71bc81468f4024f03d84ab24e69de25c0567b5c7
Author: Patrick Marlier <patrick.marlier@gmail.com>
Date:   Tue Aug 28 22:10:39 2012 +0100

    tests: Another uninitialised variable use
    
    The GError was used without being initialised.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=53900

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.