[openssl-users] Warnings Compiling openssl 1.0.2d

Matt Caswell matt at openssl.org
Tue Jul 21 22:30:54 UTC 2015



On 21/07/15 21:40, Tom Browder wrote:
> On Tue, Jul 21, 2015 at 2:16 PM, Matt Caswell <matt at openssl.org> wrote:
>> On 21/07/15 15:33, Tom Browder wrote:
>>> On Sun, Jul 19, 2015 at 11:00 AM, Tom Browder <tom.browder at gmail.com> wrote:
>>> I lied.  After rebuilding gcc 5.2.0 and rechecking I get the following
>>> warnings from building 1.0.2d:
>>>
>>> d1_both.c: In function 'dtls1_retransmit_message':
>>> d1_both.c:1261:9: warning: 'save_write_sequence' may be used
>>> uninitialized in this function [-Wmaybe-uninitialized]
>>>          memcpy(s->s3->write_sequence, save_write_sequence,
>>>          ^
>>
>> This one is entirely bogus. "save_write_sequence" is initialized on line
>> 1241. The compiler just isn't clever enough to figure that out.
> 
> Um, that initialization is in an if block, so that's not guaranteed, right?

Right, the initialization is in an if block. But the use on 1261 is also
in an if block. The conditions for each of the two if blocks are
identical. So both will be executed or neither will be executed
(assuming nothing changes the state so that the conditions evaluate
differently between the first and second if - which it doesn't).

Matt



More information about the openssl-users mailing list