[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Invalid memory reads in first_non_fsm_start_char_cstring (utf_validate.c)

From: Árpád Goretity <arpad.goretity_at_gmail.com>
Date: Sun, 3 Jan 2016 18:27:30 +0100

> The fact that it may
not have been explicitly initialized does not affect the correctness of
the code; there's no undefined behaviour being invoked here.

Please consult the relevant sections of the C standard. To be specific, see e.g. C99, 6.2.4.5: "The initial value of the object is indeterminate". Then, the definition of indeterminate at 3.17.2: "either an unspecified value or a trap representation". Subsequently, in J.2: "The behavior is undefined in the following circumstances: […] a trap representation is read by an lvalue expression that does not have character type."

Reading uninitialized memory is just as undefined as reading from unallocated areas. There IS absolutely UB being invoked, and this fact does not change based on your definition of "invalid".

Sent from my iPhone
Received on 2016-01-03 19:06:28 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.