diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2014-08-12 15:46:36 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-08-13 12:17:24 +0300 |
commit | be5df379611462c7141ab64e4b9d27552d32288c (patch) | |
tree | 926d8f491e265b229d96b300100c48341c07cacb /obexd/client | |
parent | 913f459bbc178aba98b55d4fd9ca783cee20e051 (diff) | |
download | bluez-be5df379611462c7141ab64e4b9d27552d32288c.tar.gz |
obexd: Fix possible NULL dereference
Remove snprintf error check. Fixes clang warnings below:
...
obexd/client/map.c:471:9: warning: Access to field 'message' results in
a dereference of a null pointer (loaded from variable 'err')
err->message);
^~~~~~~~~~~~
obexd/client/map.c:772:9: warning: Access to field 'message' results in
a dereference of a null pointer (loaded from variable 'err')
err->message);
^~~~~~~~~~~~
...
Diffstat (limited to 'obexd/client')
-rw-r--r-- | obexd/client/map.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/obexd/client/map.c b/obexd/client/map.c index 47afc3120..520e49212 100644 --- a/obexd/client/map.c +++ b/obexd/client/map.c @@ -447,8 +447,7 @@ static DBusMessage *map_msg_get(DBusConnection *connection, return g_dbus_create_error(message, ERROR_INTERFACE ".InvalidArguments", NULL); - if (snprintf(handle, sizeof(handle), "%" PRIx64, msg->handle) < 0) - goto fail; + snprintf(handle, sizeof(handle), "%" PRIx64, msg->handle); transfer = obc_transfer_get("x-bt/message", handle, target_file, &err); if (transfer == NULL) @@ -746,8 +745,7 @@ static void set_status(const GDBusPropertyTable *property, contents[0] = FILLER_BYTE; - if (snprintf(handle, sizeof(handle), "%" PRIx64, msg->handle) < 0) - goto fail; + snprintf(handle, sizeof(handle), "%" PRIx64, msg->handle); transfer = obc_transfer_put("x-bt/messageStatus", handle, NULL, contents, sizeof(contents), &err); |