Skip to content

fix(webserver): php_syntree various fixes - #153

Merged
got3nks merged 2 commits into
amule-org:masterfrom
RealGreenDragon:fix_php_syntree
Jun 14, 2026
Merged

fix(webserver): php_syntree various fixes#153
got3nks merged 2 commits into
amule-org:masterfrom
RealGreenDragon:fix_php_syntree

Conversation

@RealGreenDragon

Copy link
Copy Markdown

Fixes

  • Added missing break for type == PHP_VAL_STRING in cast_value_array() — without it, the function exits at the PHP_VAL_ARRAY branch before actually allocating the array.
  • Replaced PRIu64 with PRId64 in cast_value_str()PHP_VAL_INT holds a signed integer.

@got3nks got3nks left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Both fixes verified:

  • PRIu64PRId64 at line 965 — picks up exactly the inconsistency I flagged in #150's review. The codebase is now consistent in displaying int_val as signed across both php_var_dump and cast_value_str.
  • Missing break in cast_value_array STRING case — real fall-through bug. case PHP_VAL_STRING: free(val->str_val); was falling into case PHP_VAL_ARRAY: return;, so calling cast_value_array on a PHP_VAL_STRING freed the string buffer and exited without allocating the array — callers post-cast would touch uninitialised memory. The added break; lets execution reach the allocation at lines 993-994.

Approving.

@got3nks
got3nks merged commit 3aba5ea into amule-org:master Jun 14, 2026
10 checks passed
@RealGreenDragon
RealGreenDragon deleted the fix_php_syntree branch June 14, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants