cut: Fix out of boundary write on illegal list argument
It is possible to trigger an out of boundary write in cut if an invalid range with autostart has been supplied. PR: 227330 Submitted by: tobias@stoeckmann.org
This commit is contained in:
parent
f3e32074e0
commit
6872fd3c94
@ -210,6 +210,12 @@ get_list(char *list)
|
||||
needpos(maxval + 1);
|
||||
}
|
||||
|
||||
/* reversed range with autostart */
|
||||
if (maxval < autostart) {
|
||||
maxval = autostart;
|
||||
needpos(maxval + 1);
|
||||
}
|
||||
|
||||
/* set autostart */
|
||||
if (autostart)
|
||||
memset(positions + 1, '1', autostart);
|
||||
|
Loading…
Reference in New Issue
Block a user