g_strdup only duplicates the string where as here it was required to
copy txt_len bytes. When txt_len is greater than length of txt_record
then invalid read issue occured as only length of txt_record was copied
Change-Id: Ifda849d7b24a030a38bc5bfcff870ac66b044588
Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
dnssd_found_data_s *found = NULL; //LCOV_EXCL_LINE
found = GET_FOUND_DATA_P(local_handle); //LCOV_EXCL_LINE
- *value = g_strdup(found->txt_record); //LCOV_EXCL_LINE
+ *value = g_strndup(found->txt_record, found->txt_len); //LCOV_EXCL_LINE
*length = found->txt_len; //LCOV_EXCL_LINE
} else {