Skip to content

Throw instead of silently failing when creating a too long text node #15014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

nielsdos
Copy link
Member

Lower branches suffer from this as well but we cannot change the behaviour there.

@nielsdos nielsdos marked this pull request as draft July 18, 2024 18:09
@nielsdos
Copy link
Member Author

Looks like the test fails on CI because of a different libxml version. Damn how I wish we could just bump it to at least 2.10.x or so...

@Girgias
Copy link
Member

Girgias commented Jul 18, 2024

Looks like the test fails on CI because of a different libxml version. Damn how I wish we could just bump it to at least 2.10.x or so...

How long has 2.10 been available?

@nielsdos
Copy link
Member Author

Looks like the test fails on CI because of a different libxml version. Damn how I wish we could just bump it to at least 2.10.x or so...

How long has 2.10 been available?

August of 2022, but most distros are still on 2.9.x. Which means they suffer from tons of bugs because distros just pick a version, stick with it for a long time and only backport security fixes.

@Girgias
Copy link
Member

Girgias commented Jul 18, 2024

Looks like the test fails on CI because of a different libxml version. Damn how I wish we could just bump it to at least 2.10.x or so...

How long has 2.10 been available?

August of 2022, but most distros are still on 2.9.x. Which means they suffer from tons of bugs because distros just pick a version, stick with it for a long time and only backport security fixes.

pain CentOS is going to be the most annoying one again.

@nielsdos
Copy link
Member Author

pain CentOS is going to be the most annoying one again.

Fortunately, it's gone https://endoflife.date/centos
Don't know how much better CentOS stream is but that'll be supported for a long time: https://endoflife.date/centos-stream

Lower branches suffer from this as well but we cannot change the
behaviour there.
We also add NULL checks to check for allocation failure.
@nielsdos nielsdos force-pushed the parentnode-child-node-too-long-text branch from 9e686b5 to 0ff6c54 Compare July 20, 2024 17:13
@nielsdos nielsdos marked this pull request as ready for review July 20, 2024 17:41
@nielsdos
Copy link
Member Author

I slightly adapted the PR so it works with all libxml versions. New libxml versions fail when the string length is too long or the allocation fails. Old libxml versions only fail when allocation fails and silently truncate the string when the string is too long.
I added two checks: one on the string length, and one on the allocation.

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

Makes sense to me!

@nielsdos nielsdos closed this in 9435f4d Jul 21, 2024
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