bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Patch] form_driver: Missing Check for Null-Ptr-Deference


From: Leon Winter
Subject: [Patch] form_driver: Missing Check for Null-Ptr-Deference
Date: Mon, 23 Apr 2018 15:08:42 +0200
User-agent: Mutt/1.9.4 (2018-02-28)

Hi Thomas,

the function form_driver has an assert in place [1] for checking the 'current'
member which is "optmized away" in production code. However since we introduced
the unfocus functionality one can now simply SEGFAULT by doing:

   unfocus_current_field (form);
   form_driver (form, REQ_VALIDATION);

We already have a hard (non-assert) check for the 'field' member so I extended
the if branch in my patch. Maybe one wants to return a different error code.
By the way, the E_NOT_CONNECTED error code for form_driver is not mentioned in
the man page for form_driver.

Thanks for appliying my last patches, I was expecting some discourse first and
have in my original patch not provided the needed addition in the man page for
the new field option so we are now missing that as well.

Regards,
Leon

[1]
http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blob;f=form/frm_driver.c;h=3e1ccd64e9cd6cffcd196eb0babbd61b4a1d826b;hb=HEAD#l4381

Attachment: ncurses-frm-driver-nullptr-check.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]