summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArron Wang <arron.wang@intel.com>2013-03-07 14:38:14 +0800
committerJaekyun Lee <jkyun.lee@samsung.com>2013-04-08 16:49:05 +0900
commit34f436bef82bdbe4b42ec0d14bcc35a794de1f1b (patch)
treeac96933cf658af66c2c5a4b6932588f963480e46
parent6d7788b05eb7413e3b572a08b3a436d0722a349e (diff)
downloadnfc-manager-neard-34f436bef82bdbe4b42ec0d14bcc35a794de1f1b.tar.gz
nfc-manager-neard-34f436bef82bdbe4b42ec0d14bcc35a794de1f1b.tar.bz2
nfc-manager-neard-34f436bef82bdbe4b42ec0d14bcc35a794de1f1b.zip
Fix segment fault due to NULL pointer
Change-Id: Idd4e0cd7b5d2c6509f5c150af9bb9021d4f4811d Program received signal SIGSEGV, Segmentation fault. 0xb77c36d4 in __memcpy_ssse3 () from /lib/libc.so.6 (gdb) bt 0 0xb77c36d4 in __memcpy_ssse3 () from /lib/libc.so.6 1 0xb57bdf2d in net_nfc_duplicate_target_info (origin=0xb84fe570, result=0xb7b5b414) at /usr/include/bits/string3.h:52 2 0xb7b55c32 in _nfc_response_handler () from /usr/lib/libcapi-network-nfc.so.0 3 0xb57c9928 in net_nfc_client_dispatch_response (param=0xb8084580) at /usr/src/debug/nfc-manager-0.0.33/src/clientlib/net_nfc_client_dispatcher.c:453 4 0xb7854dc2 in g_idle_dispatch () from /usr/lib/libglib-2.0.so.0 5 0xb7857ddb in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 6 0xb79aad1b in _ecore_glib_select () from /usr/lib/libecore.so.1 7 0xb79a454d in _ecore_main_select () from /usr/lib/libecore.so.1 8 0xb79a5099 in _ecore_main_loop_iterate_internal () from /usr/lib/libecore.so.1 9 0xb79a541f in ecore_main_loop_begin () from /usr/lib/libecore.so.1 10 0xb7ea14f8 in elm_run () from /usr/lib/libelementary.so.1 11 0xb58ee8ee in appcore_efl_main () from /usr/lib/libappcore-efl.so.1 12 0xb7d83c75 in app_efl_main () from /usr/lib/libcapi-appfw-application.so.0 13 0xb7fe879e in main ()
-rwxr-xr-xsrc/clientlib/net_nfc_client_target_info.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/clientlib/net_nfc_client_target_info.c b/src/clientlib/net_nfc_client_target_info.c
index fb17acf..a0fb2aa 100755
--- a/src/clientlib/net_nfc_client_target_info.c
+++ b/src/clientlib/net_nfc_client_target_info.c
@@ -222,7 +222,7 @@ NET_NFC_EXPORT_API net_nfc_error_e net_nfc_duplicate_target_info(net_nfc_target_
}
}
- if (handle->raw_data.length > 0)
+ if (handle->raw_data.buffer != NULL && handle->raw_data.length > 0)
{
net_nfc_util_alloc_data(&temp->raw_data, handle->raw_data.length);
memcpy(temp->raw_data.buffer, handle->raw_data.buffer, temp->raw_data.length);