OSDN Git Service

obexd: Fix use of uninitialized count variable
authorSzymon Janc <szymon@janc.net.pl>
Wed, 13 Jun 2012 20:49:17 +0000 (22:49 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 4 Dec 2012 21:49:02 +0000 (22:49 +0100)
If opendir() call fails count would be passed to callback
uninitialized.

obexd/plugins/phonebook-dummy.c

index 035ec35..6b9d040 100644 (file)
@@ -218,7 +218,7 @@ static gboolean read_dir(void *user_data)
        struct dummy_data *dummy = user_data;
        GString *buffer;
        DIR *dp;
-       uint16_t count, max, offset;
+       uint16_t count = 0, max, offset;
 
        buffer = g_string_new("");