This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada][PR ada/71358] GNAT.Command_Line: crash in Getopt on empty Config


This patch revisits the fix for a bug in GNAT.Command_Line.Getopt: instead of
checking everywhere that an pointer is not null, we allocate a dummy object and
remove all null pointer checks.

Tested on x86_64-pc-linux-gnu, committed on trunk

2017-09-18  Bob Duff  <duff@adacore.com>

	Alternate fix for PR ada/71358
	* libgnat/g-comlin.adb (Getopt): Remove manual null access checks.
	Instead, make a local copy of Config, and if it's null, allocate an
	empty Command_Line_Configuration_Record, so we won't crash on null
	pointer dereference.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]