mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
indent(1): the check for buffer overflow has to be done before copy
This commit is contained in:
parent
33c2464207
commit
bef613ff2f
1 changed files with 2 additions and 2 deletions
|
|
@ -1193,10 +1193,10 @@ check_type:
|
|||
*sc_end++ = ' ';
|
||||
--line_no;
|
||||
}
|
||||
if (sc_end - save_com + com_end - com_start > sc_size)
|
||||
errx(1, "input too long");
|
||||
bcopy(s_lab + com_start, sc_end, com_end - com_start);
|
||||
sc_end += com_end - com_start;
|
||||
if (sc_end >= &save_com[sc_size])
|
||||
errx(1, "input too long");
|
||||
e_lab = s_lab + com_start;
|
||||
while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t'))
|
||||
e_lab--;
|
||||
|
|
|
|||
Loading…
Reference in a new issue