Skip to content

Conversation

@ndossche
Copy link
Member

@ndossche ndossche commented Nov 4, 2025

Either the buffer size or the return value needs to be checked. From a quick look into the tidy source code, this can't fail right now for our use case in practice, but it might in the future.

Either the buffer size or the return value needs to be checked.
From a quick look into the tidy source code, this can't fail right now
for our use case in practice, but it might in the future.

tidyBufInit(&buf);
tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf);
(void) tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf);
Copy link
Member

Choose a reason for hiding this comment

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

would ZEND_ASSERT(true) fits ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not really, the check is implicitly done below by checking the buffer size.

@ndossche ndossche closed this in 0584e59 Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants