git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: sprintf security holes?

From
SVSven Verdoolaege <skimo@kotnet.org>
Date
Sep 19, 2005, 12:42 UTC
Message-ID
<20050919124222.GD15165MdfPADPa@greensroom.kotnet.org>
In-Reply-To
<7voe6pv6zz.fsf@assigned-by-dhcp.cox.net>
On Mon, Sep 19, 2005 at 12:42:08AM -0700, Junio C Hamano wrote:
Show 6 quoted lines
> We _might_ be protected from buffer overrun errors [*1*], but we
> would then end up operating on a truncated data -- which would
> lead to an equally unexpected behaviour.  I do not think there
> is any guarantee that working with unexpectedly truncated data
> leads to less severe security problems than buffer overruns with
> careless sprintf().

But you can _check_ whether the data has been truncated. Just look at the return value of snprintf.

skimo
Previous: Junio C Hamano
Message 5 of 5 in “sprintf security holes?”
  1. Randal L. SchwartzSep 16, 2005
  2. Morten WelinderSep 16, 2005
  3. [Was Re: sprintf security holes?] Building on OpenBSDPeter Eriksen, Sep 16, 2005
  4. Junio C HamanoSep 19, 2005
  5. Sven VerdoolaegeSep 19, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.