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

Re: [PATCH] Add getenv.so for catching invalid getenv() use via LD_PRELOAD

From
MKMatt Kraai <kraai@ftbfs.org>
Date
Jan 5, 2013, 10:39 UTC
Message-ID
<20130105103900.GA4200@ftbfs.org>
In-Reply-To
<1357376146-7155-1-git-send-email-pclouds@gmail.com>
On Sat, Jan 05, 2013 at 03:55:46PM +0700, Nguyễn Thái Ngọc Duy wrote:
>  Perhaps this will help the getenv bug hunting (I assume we do the
>  hunting on Linux platform only). So far it catches this and is stuck
>  at getenv in git_pager().

It seems like a static analysis tool might be able to detect these problems. Is there a way to do so using sparse?

> +		n = backtrace(buffer, 100);
> +		symbols = backtrace_symbols(buffer, n);
> +		if (symbols) {
> +			for (i = 0;i < n; i++)
s/;i/; i/
-- 
Matt Kraai
https://ftbfs.org/kraai
Previous: Nguyễn Thái Ngọc DuyNext: Duy Nguyen
Message 10 of 14 in “setup: Copy an environment variable to avoid overwrites”
  1. setup: Copy an environment variable to avoid overwritesDavid Michael, Jan 5, 2013
  2. Junio C HamanoJan 5, 2013
  3. David MichaelJan 5, 2013
  4. Junio C HamanoJan 5, 2013
  5. Duy NguyenJan 5, 2013
  6. Junio C HamanoJan 5, 2013
  7. Duy NguyenJan 5, 2013
  8. Junio C HamanoJan 5, 2013
  9. Add getenv.so for catching invalid getenv() use via LD_PRELOADNguyễn Thái Ngọc Duy, Jan 5, 2013
  10. Matt KraaiJan 5, 2013
  11. Duy NguyenJan 5, 2013
  12. Jonathan NiederJan 5, 2013
  13. David MichaelJan 7, 2013
  14. Erik Faye-LundJan 7, 2013

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.