Skip Menu |
 

This queue is for tickets about the XML-LibXML CPAN distribution.

Report information
The Basics
Id: 27132
Status: resolved
Priority: 0/
Queue: XML-LibXML

People
Owner: Nobody in particular
Requestors: mjs [...] fix.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



MIME-Version: 1.0
X-Spam-Status: No, hits=-6.6 required=8.0 tests=BAYES_00,DKIM_POLICY_SIGNSOME,DK_POLICY_SIGNSOME,PERLBUG_CONF,SPF_PASS,WHOIS_NETSOLPR
X-Mailer: QUALCOMM Windows Eudora Version 6.2.3.4
Received-SPF: pass (x1.develooper.com: local policy)
X-Virus-Scanned: by amavisd-new using ClamAV at impulse.net
content-type: text/plain; charset="utf-8"; format="flowed"
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id BAA554D813B for <bug-XML-LibXML [...] rt.cpan.org>; Mon, 14 May 2007 17:15:28 -0400 (EDT)
Received: (qmail 23954 invoked by alias); 14 May 2007 21:15:27 -0000
Received: from red.impulse.net (HELO red.impulse.net) (207.154.64.11) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Mon, 14 May 2007 14:14:44 -0700
Received: from localhost (localhost [127.0.0.1]) by red.impulse.net (Postfix) with ESMTP id 28E9E1D1227 for <bug-XML-LibXML [...] rt.cpan.org>; Mon, 14 May 2007 14:14:38 -0700 (PDT)
Received: from red.impulse.net ([127.0.0.1]) by localhost (red.impulse.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 52700-01-38 for <bug-XML-LibXML [...] rt.cpan.org>; Mon, 14 May 2007 14:14:34 -0700 (PDT)
Received: from WFS-DEVEL12.fix.net (ip67-93-4-34.z4-93-67.customer.algx.net [67.93.4.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by red.impulse.net (Postfix) with ESMTP id 1C4431D11B7 for <bug-XML-LibXML [...] rt.cpan.org>; Mon, 14 May 2007 14:14:33 -0700 (PDT)
Delivered-To: cpan-bug+xml-libxml [...] diesel.bestpractical.com
Subject: NULL ptr seg fault
Return-Path: <mjs [...] fix.net>
X-Original-To: bug-XML-LibXML [...] rt.cpan.org
X-Spam-Check-BY: la.mx.develooper.com
Date: Mon, 14 May 2007 17:14:30 -0400
Message-Id: <6.2.3.4.2.20070514165604.02c0edd0 [...] pop3.impulse.net>
To: bug-XML-LibXML [...] rt.cpan.org
From: Mark Steckel <mjs [...] fix.net>
X-RT-Original-Encoding: us-ascii
Content-Length: 4041
Download (untitled) / with headers
text/plain 3.9k
Hello, XML::LibXML fails under certain circumstances due to a NULL ptr dereference. The function just below from dom.c can seg fault if the parameter ns is NULL. domAddNsDef(xmlNodePtr tree, xmlNsPtr ns) { xmlNsPtr i = tree->nsDef; while(i != NULL && i != ns) i = i->next; if( i == NULL ) { ns->next = tree->nsDef; /* Fails if ns is NULL */ tree->nsDef = ns; } } This error seems to occur because the return value from a libxml2 function is not checked for failure before being passed to domAddNsDef(). Specifically, the function dom.c:_domReconcileNsAttr() calls xmlCopyNamespace() which returns NULL if an error occurs. This error occurs with libxml2-2.6.27 and libxml2-2.6.28. I created the following work-around. diff -r -w -c XML-LibXML-1.63/dom.c XML-LibXML-1.63-new/dom.c *** XML-LibXML-1.63/dom.c 2007-02-26 08:24:12.000000000 -0500 --- XML-LibXML-1.63-new/dom.c 2007-05-14 14:03:34.000000000 -0400 *************** *** 114,119 **** --- 114,120 ---- { /* Replace/Add the namespace declaration on the element */ attr->ns = xmlCopyNamespace(attr->ns); + if (attr->ns != NULL) domAddNsDef(tree, attr->ns); } } It probably makes more sense to validate the ptr's that are passed to domAddNsDef() but I am uncertain what action should be taken if either ptr is NULL. Additional info follows. Thanks Mark ------------ CentOS 4.4 [root@dizzy perl]# uname -a Linux dizzy.abcxyz.com 2.6.9-42.EL #1 Sat Aug 12 09:17:58 CDT 2006 i686 i686 i386 GNU/Linux root@dizzy perl]# perl -V Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=linux, osvers=2.6.9-42.el, archname=i686-linux-thread-multi uname='linux dizzy.huffingtonpost.com 2.6.9-42.el #1 sat aug 12 09:17:58 cdt 2006 i686 i686 i386 gnulinux ' config_args='' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include' ccversion='', gccversion='3.4.6 20060404 (Red Hat 3.4.6-3)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='gcc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc libc=/lib/libc-2.3.4.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.3.4' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP THREADS_HAVE_PIDS USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Built under linux Compiled at Jan 30 2007 16:49:58 @INC: /usr/local/lib/perl5/5.8.8/i686-linux-thread-multi /usr/local/lib/perl5/5.8.8 /usr/local/lib/perl5/site_perl/5.8.8/i686-linux-thread-multi /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl .
MIME-Version: 1.0
In-Reply-To: <6.2.3.4.2.20070514165604.02c0edd0 [...] pop3.impulse.net>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-31206-1179179899-1610.27132-0-0 [...] rt.cpan.org>
References: <6.2.3.4.2.20070514165604.02c0edd0 [...] pop3.impulse.net>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 94
yes, I have committed the same fix some weeks ago in the subversion. thanks anyway. -- Petr
MIME-Version: 1.0
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00,DKIM_POLICY_SIGNSOME,DK_POLICY_SIGNSOME,SPF_PASS
In-Reply-To: <rt-3.6.HEAD-31206-1179179899-1610.27132-6-0 [...] rt.cpan.org>
X-Mailer: QUALCOMM Windows Eudora Version 6.2.3.4
Received-SPF: pass (x1.develooper.com: local policy)
References: <RT-Ticket-27132 [...] rt.cpan.org> <6.2.3.4.2.20070514165604.02c0edd0 [...] pop3.impulse.net> <rt-3.6.HEAD-31206-1179179899-1610.27132-6-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"; format="flowed"
X-Virus-Scanned: by amavisd-new using ClamAV at impulse.net
X-RT-Original-Encoding: us-ascii
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 7E5F84D80CA for <bug-XML-LibXML [...] rt.cpan.org>; Mon, 14 May 2007 18:05:44 -0400 (EDT)
Received: (qmail 3760 invoked by alias); 14 May 2007 22:05:43 -0000
Received: from red.impulse.net (HELO red.impulse.net) (207.154.64.11) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Mon, 14 May 2007 15:04:15 -0700
Received: from localhost (localhost [127.0.0.1]) by red.impulse.net (Postfix) with ESMTP id 84DCD1D110E for <bug-XML-LibXML [...] rt.cpan.org>; Mon, 14 May 2007 15:04:10 -0700 (PDT)
Received: from red.impulse.net ([127.0.0.1]) by localhost (red.impulse.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 54980-01-74 for <bug-XML-LibXML [...] rt.cpan.org>; Mon, 14 May 2007 15:04:05 -0700 (PDT)
Received: from WFS-DEVEL12.fix.net (rrcs-72-43-187-210.nyc.biz.rr.com [72.43.187.210]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by red.impulse.net (Postfix) with ESMTP id 9AF3D1D0DC0 for <bug-XML-LibXML [...] rt.cpan.org>; Mon, 14 May 2007 15:04:04 -0700 (PDT)
Delivered-To: cpan-bug+xml-libxml [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #27132] NULL ptr seg fault
Return-Path: <mjs [...] fix.net>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: bug-XML-LibXML [...] rt.cpan.org
Date: Mon, 14 May 2007 18:04:00 -0400
Message-Id: <6.2.3.4.2.20070514180320.02b71ad0 [...] pop3.impulse.net>
To: bug-XML-LibXML [...] rt.cpan.org
From: Mark Steckel <mjs [...] fix.net>
X-RT-Original-Encoding: utf-8
RT-Message-ID: <rt-3.6.HEAD-31153-1179180348-304.27132-0-0 [...] rt.cpan.org>
Content-Length: 316
Download (untitled) / with headers
text/plain 316b
Cool! Two questions then: 1) When is the next release expected? 2) Is there anonymous subversion access? Thanks Mark At 05:58 PM 5/14/2007, you wrote: Show quoted text
><URL: http://rt.cpan.org/Ticket/Display.html?id=27132 > > >yes, I have committed the same fix some weeks ago in the subversion. > >thanks anyway. > >-- Petr
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-31153-1179180348-304.27132-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-31189-1179213902-1176.27132-0-0 [...] rt.cpan.org>
References: <RT-Ticket-27132 [...] rt.cpan.org> <6.2.3.4.2.20070514165604.02c0edd0 [...] pop3.impulse.net> <rt-3.6.HEAD-31206-1179179899-1610.27132-6-0 [...] rt.cpan.org> <6.2.3.4.2.20070514180320.02b71ad0 [...] pop3.impulse.net> <rt-3.6.HEAD-31153-1179180348-304.27132-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 617
Download (untitled) / with headers
text/plain 617b
On po 14.kvě.2007 18:05:48, mjs@fix.net wrote: Show quoted text
> > Cool! Two questions then: > > 1) When is the next release expected?
I'm not yet determined about it, but sure not in the next three weeks or so, I'm too busy finishing other stuff. Show quoted text
> 2) Is there anonymous subversion access?
yes, read the last paragraph in the README file http://search.cpan.org/src/PAJAS/XML-LibXML-1.63/README -- Petr Show quoted text
> > At 05:58 PM 5/14/2007, you wrote: >
> ><URL: http://rt.cpan.org/Ticket/Display.html?id=27132 > > > > >yes, I have committed the same fix some weeks ago in the
subversion. Show quoted text
> > > >thanks anyway. > > > >-- Petr
>


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.