Skip to content

Commit

Permalink
Fix SDKCall NULL_STRING (#2178)
Browse files Browse the repository at this point in the history
  • Loading branch information
fdxx authored Nov 2, 2024
1 parent 34e9605 commit 2be15ff
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion extensions/sdktools/vdecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2be15ff

Please sign in to comment.