Re: [PATCH v3] vt: Fix a missing-check bug in con_init()

From: Jiri Slaby
Date: Mon Jun 10 2019 - 03:14:31 EST


On 09. 06. 19, 2:15, Nicolas Pitre wrote:
>>>> +fail1:
>>>> + while (currcons > 0) {
>>>> + currcons--;
>>>> + kfree(vc_cons[currcons].d->vc_screenbuf);
>>>> +fail2:
>>>> + kfree(vc_cons[currcons].d);
>>>> + vc_cons[currcons].d = NULL;
>>>> + }
>>
>> Wait, will that even work? You can jump into the middle of a while
>> loop?
>
> Absolutely.

In C99, exceptions are only blocks with variable-sized declarations
(like "int a[b]").

thanks,
--
js
suse labs