From: Julian S. <js...@ac...> - 2007-03-29 23:59:42
|
On Friday 30 March 2007 00:40, Nicholas Nethercote wrote: > On Fri, 30 Mar 2007, Julian Seward wrote: > >> Patch is below. > > > > Nice! Did it allow you to track down the original problem with > > env vars (now lost in the mists of time) ? > > So you've essentially added eager definedness checking for environment > variables -- is that right? Oh, yes, you're right. Hang on. That's not good. The original reason I wrote a getenv wrapper is I thought that the glibc one over-read memory (like memcpy etc). But I was wrong, it was the application putting bogus strings into the environment. So now Dirk is trying to detect this when at the putenv/addenv point rather than later in getenv, when it is really too late. Sounds reasonable; on the other hand it's a bit specialised and would cause a false error in the case where you added an undefined string to the environment and then never looked it up. Should be be in the business of checking arguments to arbitrary libc functions? I had not realised this before, but the function wrapping stuff makes it possible to do that if we want. J |