From: Bob D. <bd...@si...> - 2007-12-03 22:17:40
|
Hey, Sorry for the long delay. I had some computer problems. Would you be able to send the patches as attachments? Thanks! - Bob On Wed, 2007-11-28 at 13:44 -0500, Steve Mokris wrote: > [re-sending this since it didn't seem to go through the first time.] > > Hi. > > First, thanks for rlib. I've been doing some tests with it and have > been impressed that you've already almost exactly implemented the > reporting system I'd just designed :^) . I wrote a little PHP wrapper > for it, allowing users to easily generate parameterized SQL reports.. > Planning to release it once it's matured a little. > > Anyway.. I spent most of the morning trying to track down what I > eventually discovered was a segfault in parse_line_array. And it > turned out this segfault was caused by a typo in my report. I typed: > <field width="1" /> > when I meant to type: > <literal width="1" /> > ...which crashed because the parser code was assuming there was a > 'value' present for <field>. > > This could easily be avoided with an r_error and graceful quit, I > think. Below is a patch. > > Hope this helps. > > Steve > > =========== > > --- parsexml.c (revision 3084) > +++ parsexml.c (working copy) > @@ -98,6 +98,10 @@ > struct rlib_report_field *f = g_new0(struct rlib_report_field, 1); > current = (void *)g_new0(struct rlib_element, 1); > sp = xmlGetProp(cur, (const xmlChar *) "value"); > + if(!sp) { > + r_error(r, "Line: %d - <field> is missing 'value' attribute. \n", > xmlGetLineNo (cur),cur->name); > + return NULL; > + } > #if DISABLE_UTF8 > utf8_to_8813(r, f->value, (gchar *)sp); > #else > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > Rlib-devel mailing list > Rli...@li... > https://lists.sourceforge.net/lists/listinfo/rlib-devel |