fix(webserver): php_amule_lib various fixes - #152
Conversation
…and amule_load_stats_tree functions of php_amule_lib
…nload_cmd function of php_amule_lib
got3nks
left a comment
There was a problem hiding this comment.
Thanks. All three fixes verified:
GetTagByName→GetTagByNameSafefor the fourEC_TAG_STATS_*+EC_TAG_CATEGORY_TITLEcall sites — correct null-deref guards.amule_load_stats_treenull-check onstats_root+delete response— correct, also avoids the leak on the error path.- String-check removal — same pattern + rationale as #151.
Other unsafe GetTagByName(...)->method() chains exist in this file (lines 269, 278, 285, 293, 432) but those are separate concerns and fine to leave for a follow-up. This PR's scope is correctly tight.
Approving.
@got3nks I checked but no fix needed in lines 269, 278, 285, 293, 432. After each Thank you very much for review ! |
|
You're right — verified all five, every dereference is already gated by a NULL check ( |
Fixes:
php_get_amule_stats,php_get_amule_categories, andamule_load_stats_treefunctionsphp_native_search_download_cmdfunction (useless as the value is cast to int, so an int parameter value can be accepted, as happens in other functions such asphp_native_server_cmd)