Add NULL check to GetEntPropString return. (#1376)

This can be NULL for non-interned strings that don't have a value set.
This commit is contained in:
Nicholas Hastings 2020-10-27 18:51:12 -04:00 committed by GitHub
parent 94ea925152
commit 8e7d41ec02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2201,9 +2201,15 @@ static cell_t GetEntPropString(IPluginContext *pContext, const cell_t *params)
} }
} }
size_t len; if (src)
pContext->StringToLocalUTF8(params[4], params[5], src, &len); {
return len; size_t len;
pContext->StringToLocalUTF8(params[4], params[5], src, &len);
return len;
}
pContext->StringToLocal(params[4], params[5], "");
return 0;
} }
static cell_t SetEntPropString(IPluginContext *pContext, const cell_t *params) static cell_t SetEntPropString(IPluginContext *pContext, const cell_t *params)