libutil properties_read() bug: patch for review

From: Antony Mawer (fbsd-hackers_at_mawer.org)
Date: 11/24/05

  • Next message: BSD: "6.0-STABLE & powerd: eating my keyboard input"
    Date: Thu, 24 Nov 2005 11:14:14 +1100
    To: freebsd-hackers@freebsd.org
    
    

    Hi,

    I recently hit upon a bug in sysinstall, getting an "Invalid realloc
    size of 0" error that caused sysinstall to terminate. I eventually
    tracked it down to a bug in the properties_read() function of libutil,
    which occurs only when reading a properties file of 4096 bytes or
    greater. This is because libutil discards its current state when the
    buffer runs out (4096 bytes) and it must refill the buffer, causing the
    properties file (*.inf) to be incorrectly read.

    I've made a patch that's attached to the PR I filed, PR 89181, but was
    hoping to get some extra eyes on the patch to make sure that there's
    nothing amiss with the patch:

         http://www.freebsd.org/cgi/query-pr.cgi?pr=89181

    Hopefully someone can review this and see about getting it committed for
    6.1!

    -Antony

    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: BSD: "6.0-STABLE & powerd: eating my keyboard input"

    Relevant Pages

    • Re: Writable packet CD-RW mounting broken in 2.6.26 by your commit 68154e90c9d1492d570671ae181d9
      ... This patch adds bio_copy_kern similar to ... Sorry about the bug and thanks for the investigation. ... this can't be an unaligned buffer or the code wouldn't have ... struct bio *bio; ...
      (Linux-Kernel)
    • Re: Self-knowledge of a script
      ... This is because no developer of Tcl uses it (and Apple don't ... I never said impossible, I said if it is a bug, it is more ... The second patch, which actually worked...perfectly, ... was crazy talk about readjusting the buffer boundaries. ...
      (comp.lang.tcl)
    • Re: libutil properties_read() bug: patch for review
      ... > size of 0" error that caused sysinstall to terminate. ... > tracked it down to a bug in the properties_readfunction of libutil, ... > buffer runs out and it must refill the buffer, ... > I've made a patch that's attached to the PR I filed, PR 89181, but was ...
      (freebsd-hackers)
    • Re: [PATCH 1/2] ftrace: disable tracing on resize
      ... It fixed a bug I was able to reproduce, ... This patch addresses the bug found here: ... the buffer was not protected as much as it was originally. ... if (cnt>= sizeof(buf)) ...
      (Linux-Kernel)
    • Weekly Python Patch/Bug Summary
      ... Patch / Bug Summary ... http://python.org/sf/606098 closed by rhettinger ... http://python.org/sf/1088716 closed by loewis ...
      (comp.lang.python)