diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2007-05-04 21:46:02 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2007-05-04 21:46:02 +0000 |
commit | cfb86c2cae67f27e673f19fd5e8447c1090679e4 (patch) | |
tree | 6ef5cdd2dda88db79c4f39401c8bf01de37536b9 /hcid | |
parent | 76adbf6de1989fef3f6341e845ddf21fc08efe4a (diff) |
Fix use of uninitialized memory
Diffstat (limited to 'hcid')
-rw-r--r-- | hcid/dbus-adapter.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/hcid/dbus-adapter.c b/hcid/dbus-adapter.c index 645ecaa9..5aeab81c 100644 --- a/hcid/dbus-adapter.c +++ b/hcid/dbus-adapter.c @@ -1611,7 +1611,7 @@ static DBusHandlerResult adapter_get_remote_features(DBusConnection *conn, DBusMessageIter iter, array_iter; uint8_t features[8], *ptr = features; const char *addr; - char tmp[3], *str; + char *str; int i; if (!dbus_message_get_args(msg, NULL, @@ -1630,7 +1630,11 @@ static DBusHandlerResult adapter_get_remote_features(DBusConnection *conn, memset(features, 0, sizeof(features)); for (i = 0; i < sizeof(features); i++) { + char tmp[3]; + memcpy(tmp, str + (i * 2), 2); + tmp[2] = '\0'; + features[i] = (uint8_t) strtol(tmp, NULL, 16); } |