diff options
author | Tom Tromey <tromey@adacore.com> | 2021-05-17 12:55:18 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2021-05-17 13:01:42 -0600 |
commit | baea2f9d52d606f6b58a736420017c98351f5b5c (patch) | |
tree | 9edfb3734519a9a46900e2436f78fc02522d9699 /gdb/main.h | |
parent | 473ab96443eaf08f1a56c116c82410de2022c29b (diff) | |
download | gdb-baea2f9d52d606f6b58a736420017c98351f5b5c.zip gdb-baea2f9d52d606f6b58a736420017c98351f5b5c.tar.gz gdb-baea2f9d52d606f6b58a736420017c98351f5b5c.tar.bz2 |
Fix buffer underflow in add_path
Address sanitizer pointed out a buglet in source.c:add_path.
In this test, from gdb.base/source-dir.exp:
(gdb) set directories :/foo:/bar
... 'p[-1]' will result in a buffer underflow.
This patch fixes the bug by introducing a new check.
2021-05-17 Tom Tromey <tromey@adacore.com>
* source.c (add_path): Check 'p' before using 'p[-1]'.
Diffstat (limited to 'gdb/main.h')
0 files changed, 0 insertions, 0 deletions