From: Wootak Jung Date: Thu, 24 May 2018 04:45:09 +0000 (+0900) Subject: Fix prevent issue X-Git-Tag: accepted/tizen/unified/20180527.044852 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2Faccepted%2Ftizen%2Funified%2F20180527.044852;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git Fix prevent issue Change-Id: I7a2f9f1bf6b19a70e40cbf80d624d55d7eab77e5 --- diff --git a/bt-otp/bt-otpserver.c b/bt-otp/bt-otpserver.c index 80348d1..93d3c50 100644 --- a/bt-otp/bt-otpserver.c +++ b/bt-otp/bt-otpserver.c @@ -1820,6 +1820,9 @@ int _bt_otp_read_cb(const char *obj_path, char **value, int *len, uint16_t offse *len = info->value_length - offset; *value = (char *)malloc(sizeof(char)*(*len)); + if (*value == NULL) + return BLUETOOTH_ATT_ERROR_INTERNAL; + memcpy(*value, info->char_value, *len); return BLUETOOTH_ATT_ERROR_NONE;