Do not typecast to resource type at all. This might lead to attempt of access to the invalid memory area and segmentation fault.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-02-08 14:28:04 +01:00
parent fa0b487cc0
commit a7b4c6e880
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 1 additions and 2 deletions

View File

@ -449,8 +449,7 @@ PH7_PRIVATE sxi32 PH7_MemObjToCallback(ph7_value *pObj) {
PH7_PRIVATE sxi32 PH7_MemObjToResource(ph7_value *pObj) {
sxi32 rc = SXRET_OK;
if((pObj->iFlags & MEMOBJ_RES) == 0) {
SyBlobReset(&pObj->sBlob); /* Reset the internal buffer */
rc = MemObjStringValue(&pObj->sBlob, &(*pObj), TRUE);
pObj->x.iVal = 0;
}
MemObjSetType(pObj, MEMOBJ_RES);
return rc;