msm8974-common: libril: Replace strncpy with strlcpy.
Use strlcpy instead of strncpy when copying strings to make sure the copy is always null-terminated. Bug:73436938 [haggertk: Our original CAF base had the actual "replace strncpy with strlcpy" part of this change already. This just adds the expected sendErrorResponse()] Change-Id: I12d4883c22a180e2136dc8c85bc0394ddcdcb706
This commit is contained in:
parent
e11fb2c255
commit
0902dcd5a7
@ -539,6 +539,9 @@ bool copyHidlStringToRil(char **dest, const hidl_string &src, RequestInfo *pRI,
|
||||
RLOGE("Copy of the HIDL string has been truncated, as "
|
||||
"the string length reported by size() does not "
|
||||
"match the length of string returned by c_str().");
|
||||
free(*dest);
|
||||
*dest = NULL;
|
||||
sendErrorResponse(pRI, RIL_E_INTERNAL_ERR);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user