Fix SDKCall NULL_STRING (#2178)

This commit is contained in:
fdxx 2024-11-02 23:27:08 +08:00 committed by GitHub
parent 34e9605519
commit 2be15ff629
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -575,7 +575,13 @@ DataStatus DecodeValveParam(IPluginContext *pContext,
case Valve_String:
{
char *addr;
pContext->LocalToString(param, &addr);
pContext->LocalToStringNULL(param, &addr);
if (addr == NULL && (data->decflags & VDECODE_FLAG_ALLOWNULL) == 0)
{
pContext->ThrowNativeError("NULL not allowed");
return Data_Fail;
}
*(char **)buffer = addr;
return Data_Okay;
}