Re: Hidden read of indeterminate memory

From: Jeremy Yallop (jeremy_at_jdyallop.freeserve.co.uk)
Date: 12/19/03


Date: 19 Dec 2003 13:57:00 GMT

Kevin D Quitt wrote:
> On Thu, 18 Dec 2003 11:18:04 GMT, pete <pfiland@mindspring.com> wrote:
>>I understand you to mean that the use of an indeterminate unsigned
>>char value, is unspecified behavior. Is that right ?
>
> Please trim your posts, and no, you're not right. Using the value of any
> unsigned char is always defined behaviour.

I think that "unspecified" is right. For instance, consider reading
from a union member of type unsigned char after writing to a different
member (of type float, say). The bit pattern of the object must yield
a valid value when interpreted as unsigned char, but /which/ value
depends on the representation that the implementation uses for float.

Jeremy.



Relevant Pages

  • Re: Accessing members in array
    ... > Realise that a BYTE is of type unsigned char, 0 to 255 which is not ... > used to represent a string, instead, char is as you will be aware. ... > generally a crap idea to represent a string by a BYTE ... > should fix the corruption issue. ...
    (microsoft.public.vc.language)
  • Re: Projects
    ... Your version of strcmp evaluates the bytes as type char. ... The bytes are supposed to be evaluated as type unsigned char. ... If the value of the first byte of the s string is -1 and the ...
    (comp.lang.c)
  • Re: Public disclosure of discovered vulnerabilities
    ... Paul Rubin wrote: ... > The technical issue is that a sensibly defined toupper function would ... > work for all possible char values, but the one defined in the standard ...
    (sci.crypt)