bug in xml.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

I believe there is a minor bug in the function pj_xml_print( ... )

I assume that the intention is that -1 should be returned if the buffer 
is not large enough when printing the xml nodes with xml_print_node(...)

However if a prolog is used this can never happen since the prolog_len 
is added after the recursive function:

printed = xml_print_node(node, 0, buf+prolog_len, len-prolog_len) + 
prolog_len;

If xml_print_node returns -1 due to a non sufficient buffer the result 
will be 39 anyway which is ((-1 + prolog_len) + the terminating \n added 
on the line below).

Best Regards

Johan Lantz






[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux