GNU bug report logs - #28859
Segmentation fault with NULL pointer dereference in 'stty'

Previous Next

Package: coreutils;

Reported by: Jaeseung Choi <jschoi.2022 <at> gmail.com>

Date: Mon, 16 Oct 2017 07:14:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Pádraig Brady <P <at> draigBrady.com>, Jim Meyering <jim <at> meyering.net>, 28859 <at> debbugs.gnu.org, jschoi.2022 <at> gmail.com
Subject: bug#28859: Segmentation fault with NULL pointer dereference in 'stty'
Date: Tue, 17 Oct 2017 11:28:51 -0700
On 10/17/2017 12:37 AM, Pádraig Brady wrote:
> +#define check_argument(arg) \
> +  if (k == n_settings - 1 || ! settings[k+1]) \
> +    { \
> +      error (0, 0, _("missing argument to %s"), quote (arg)); \
> +      usage (EXIT_FAILURE); \
> +    }

How about making this a static function instead of a macro? I am leery 
of macros for all the usual reasons. Admittedly the static function will 
also need k, n_settings, and settings as arguments; still, it seems 
cleaner to me overall.

If you do keep it a macro, please put it inside a do...while so that it 
doesn't cause problems as a then-part with a following else.





This bug report was last modified 7 years and 274 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.