Skip to content
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

Segfault when creating CDATA with Integer or Float #1669

Closed
ponkyky opened this issue Aug 10, 2017 · 2 comments
Closed

Segfault when creating CDATA with Integer or Float #1669

ponkyky opened this issue Aug 10, 2017 · 2 comments
Labels
topic/memory Segfaults, memory leaks, valgrind testing, etc.
Milestone

Comments

@ponkyky
Copy link

ponkyky commented Aug 10, 2017

When I create a CDATA node with an Integer or a Float as content, the ruby interpreter segfault.

doc = Nokogiri::XML::Document.new
elem = Nokogiri::XML::CDATA.new(doc, 1)

nokogiri -v

Nokogiri (1.8.0)
warnings: []
nokogiri: 1.8.0
ruby:
version: 2.4.0
platform: x86_64-linux
description: ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
engine: ruby
libxml:
binding: extension
source: packaged
libxml2_path: "/home/ponky/.rvm/gems/ruby-2.4.0/gems/nokogiri-1.7.2/ports/x86_64-pc-linux-gnu/libxml2/2.9.4"
libxslt_path: "/home/ponky/.rvm/gems/ruby-2.4.0/gems/nokogiri-1.7.2/ports/x86_64-pc-linux-gnu/libxslt/1.1.29"
libxml2_patches:
- 0001-Fix-comparison-with-root-node-in-xmlXPathCmpNodes.patch
- 0002-Fix-XPointer-paths-beginning-with-range-to.patch
- 0003-Disallow-namespace-nodes-in-XPointer-ranges.patch
libxslt_patches:
- 0001-Fix-heap-overread-in-xsltFormatNumberConversion.patch
- 0002-Check-for-integer-overflow-in-xsltAddTextString.patch
compiled: 2.9.4
loaded: 2.9.4

@flavorjones
Copy link
Member

Thanks for reporting this. I believe we just need to double-check the type of arguments for this method. Will take a look!

@flavorjones
Copy link
Member

Fixed in c766f6e, will be in v1.8.1.

@flavorjones flavorjones added this to the 1.8.1 milestone Aug 10, 2017
@flavorjones flavorjones added the topic/memory Segfaults, memory leaks, valgrind testing, etc. label Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/memory Segfaults, memory leaks, valgrind testing, etc.
Projects
None yet
Development

No branches or pull requests

2 participants