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
68c7cdc07b
commit
37e8ba211c
@ -210,6 +210,12 @@ get_list(char *list)
|
|||||||
needpos(maxval + 1);
|
needpos(maxval + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* reversed range with autostart */
|
||||||
|
if (maxval < autostart) {
|
||||||
|
maxval = autostart;
|
||||||
|
needpos(maxval + 1);
|
||||||
|
}
|
||||||
|
|
||||||
/* set autostart */
|
/* set autostart */
|
||||||
if (autostart)
|
if (autostart)
|
||||||
memset(positions + 1, '1', autostart);
|
memset(positions + 1, '1', autostart);
|
||||||
|
Loading…
Reference in New Issue
Block a user