ircu 2.10.11's doprintf() does not null-terminate strings generated when 
converting integers. I've only tested this patch lightly, but it should 
work.

Please let me know if you have any questions, or if Mozilla's mailnews 
client messed something up.

# Zoot

*** ircd/ircd_snprintf.c        Sat Apr 21 17:49:12 2001
--- ircd/ircd_snprintf.c        Sun Aug  4 13:18:08 2002
***************
*** 1830,1841 ****
     /* We've eaten the arguments, we have all the information we need for
      * the conversion.  Time to actually *do* the conversion
      */
     if ((fld_s.flags & CONV_MASK) == CONV_INT) {
       /* convert an integer */
!       char intbuf[INTBUF_LEN], **table = 0, *tstr;
       int ibuf_loc = INTBUF_LEN, ilen, zlen = 0, plen = 0, elen = 0;

       if (fld_s.base == BASE_OCTAL) /* select string table to use */
       table = octal;
       else if (fld_s.base == BASE_DECIMAL)
       table = decimal;
--- 1830,1843 ----
     /* We've eaten the arguments, we have all the information we need for
      * the conversion.  Time to actually *do* the conversion
      */
     if ((fld_s.flags & CONV_MASK) == CONV_INT) {
       /* convert an integer */
!       char intbuf[INTBUF_LEN + 1], **table = 0, *tstr;
       int ibuf_loc = INTBUF_LEN, ilen, zlen = 0, plen = 0, elen = 0;
+
+       intbuf[INTBUF_LEN] = '\0';

       if (fld_s.base == BASE_OCTAL) /* select string table to use */
       table = octal;
       else if (fld_s.base == BASE_DECIMAL)
       table = decimal;


Reply via email to