Skip to content
PR Quorum
Sign inStart free
← Review gallery
antirez/ds4 #571openreviewed 5h ago

server: restore schema-declared argument types for GLM tool calls

by solodddd+174 181 filesreviewed in 1m 51sView PR on GitHub
minor notesThe panel surfaced minor issues worth a look before merge.2 findings

Reviewer panel

Correctness
deepseek/deepseek-v4-pro
errored
Security
deepseek/deepseek-v4-pro
0 found
Architecture
deepseek/deepseek-v4-pro
2 found

Findings

01Mmedconf 85%

json_schema_value_type leaks memory on early return

ds4_server.c:1433

When the function encounters a key other than "type" and then fails to skip the value (json_skip_value returns false), it returns NULL without freeing the key that was just allocated by json_string. This leaks the key string.

02Llowconf 90%

json_schema_value_type leaks memory on malformed input

ds4_server.c:1433

If json_string succeeds for the key but the following character is not ':' (the if (*p != ':') branch), the function returns NULL after freeing key. However, if json_string fails (returns false), the function returns NULL without freeing key because key may have been partially allocated or left as NULL. The json_string implementation is not shown, but if it allocates key before failing, this is a leak. Even if it doesn't, the pattern is fragile.

Want this on your own pull requests?
The same reviewer panel runs on every PR — one focused review, no noise.
Start freeLive demo