libxml C fun

Mark Ellis mark.uzumati at virgin.net
Thu Dec 5 02:57:27 PST 2002


On 2002.12.02 19:44 Neven Has wrote:
> On Mon, Dec 02, 2002 at 03:34:25PM +0000, Mark Ellis wrote:
> >          char *xml = NULL;
> >          xmlDocPtr xmldoc = NULL;
> >
> > /* reads a file and stores it all in a string */
> >          xml = read_profile(profile);
> 
> That's one big string. :) (If it's a string, see below.)
> 
> > 	if (xml == NULL) {
> >                  return 0;
> > 	}
> >
> >          profile_len = strlen(xml)+1;
> >
> >          if ((xmldoc = xmlParseMemory(xml, profile_len)) == NULL) {
> >                  XFREE(xmlstr);
> >                  fprintf(stderr, "Profile parse error : %s\n",
> profile);
> >                  return 0;
> >          }
> 
> > #8  0x08059848 in xmlParseMemory (buffer=0x8165a48 "",
> size=135682632)
> > at parser.c:10590
> 
> xmlParseMemory("", 135682632) is what's called.
> 
> Try printing xml before xmlParseMemory() and checking profile_len
> there. Maybe it's not null-terminated or something? Something wrong in
> read_profile() probably.
> 
> 

This makes no sense, the string is valid, the length is fine, yet 
xmlParseMemory is dealing with gibberish. Gonna have to get more 
involved in this, thanks for your input guys.

Mark
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe alfs-discuss' in the subject header of the message



More information about the alfs-discuss mailing list