Skip to content

Line number capped at 65535 but libxml2 already returns long. #1617

@pakore

Description

@pakore

ext/nokogiri/xml_node.c:1263 contains the line:

return INT2NUM(xmlGetLineNo(node));

but the signature of xmlGetLineNo according to libxml2 2.8.0 (tree.c:4527) is

long
xmlGetLineNo(xmlNodePtr node)

so libxml2 is returning a long that is passed to a macro function that accepts an int , so long is converted to int, and hence capped to 65535

The solution would be to change ext/nokogiri/xml_node.c:1263 to

return LONG2NUM(xmlGetLineNo(node));

and thus a problem that's been around for some years would be fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions