Re: lcc-win32

From: Keith Thompson (kst-u_at_mib.org)
Date: 10/10/04


Date: Sat, 09 Oct 2004 23:29:59 GMT

jacob navia <jacob@jacob.remcomp.fr> writes:
[...]
> All functions in the library should return an error code if confronted
> with invalid inputs. It suffices for a malitious program to pass wrong
> data (or a program that contained an error already passed uninitialized
> memory, etc) to provoke memory overwrites.

strlen(NULL) invokes undefined behavior. strlen(x) invokes undefined
behavior if x doesn't point to a null-terminated string. Do you
advocate changing the definition of strlen() so it doesn't invoke
undefined behavior in such cases?

If you want to implement a bulletproof replacement for the C standard
library, go ahead and do it. If it becomes widespread enough, it
might even be incorporated into the next version of the standard.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center             <*>  <http://users.sdsc.edu/~kst>
We must do something.  This is something.  Therefore, we must do this.


Relevant Pages

  • [head tinderbox] failure on powerpc64/powerpc
    ... cleaning up the object tree ... {standard input}:58: Error: unsupported relocation against r1 ... *** Error code 1 ...
    (freebsd-current)
  • Re: Final Procedure
    ... might still want to know success/failure as a general standard practice. ... I usually include an error code processing module that retrieves standardized text strings associatd with error codes. ...
    (comp.lang.fortran)
  • Re: Any info about "Thread has exited with code 32772 (0x8004)"?
    ... If the installer program standard is to return a meaningful error code, ... But if there is no standard, failure to adhere to ...
    (microsoft.public.vc.mfc)
  • Internal compiler error
    ... {standard input}:0: cc: Internal compiler error: program cc1 got fatal signal ... *** Error code 1 ...
    (freebsd-stable)