Skip to content

Conversation

nielsdos
Copy link
Member

Fixes GH-11952.

Comment on lines +787 to +788
php_libxml_ctx_error(context,
"Failed to load external entity because the resolver function returned null\n");
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it make more sense to move this warning where the RETVAL is handled?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know. There are quite a few possible paths that lead to this branch. I think refactoring that complicates things more than what we gain? I could be wrong or misunderstanding ofc.

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking of just moving the warning for the null type where the // else retval is null comment is.

But that might complicate the logic for the rest :/

Copy link
Member Author

Choose a reason for hiding this comment

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

Right I see, but then we'll still need a NULL-check for ID at line 786 so we don't get a double warning (and a NULL deref of ID). So I don't think we gain much by that. I prefer to keep the structure as-is.

Copy link
Member

Choose a reason for hiding this comment

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

ACK

@nielsdos nielsdos closed this in e1cb721 Aug 24, 2023
jorgsowa pushed a commit to jorgsowa/php-src that referenced this pull request Aug 24, 2023
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.

Confusing warning when blocking entity loading via libxml_set_external_entity_loader

2 participants