mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-22 04:50:07 +00:00
argp: fix pointer-subtraction bug
* argp/argp-help.c (hol_append): Don't subtract pointers to different arrays, as this can run afoul of -fcheck-pointer-bounds. See the thread containing Bruno Haible's report in: http://lists.gnu.org/archive/html/bug-gnulib/2017-05/msg00171.html Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
parent
dfc3907cde
commit
5ec029c883
@ -867,7 +867,8 @@ hol_append (struct hol *hol, struct hol *more)
|
||||
|
||||
/* Fix up the short options pointers from HOL. */
|
||||
for (e = entries, left = hol->num_entries; left > 0; e++, left--)
|
||||
e->short_options += (short_options - hol->short_options);
|
||||
e->short_options
|
||||
= short_options + (e->short_options - hol->short_options);
|
||||
|
||||
/* Now add the short options from MORE, fixing up its entries
|
||||
too. */
|
||||
|
Loading…
Reference in New Issue
Block a user