fix(util/sexpr/format): potential access memory violation
This commit is contained in:
parent
accc9dc38b
commit
38394d85dd
1 changed files with 2 additions and 2 deletions
|
@ -225,8 +225,8 @@ int format::space_upto_line_break(sexpr const & s, int available, bool & found_n
|
|||
sexpr list = sexpr_compose_list(s);
|
||||
int len = 0;
|
||||
while (!is_nil(list) && !found_newline) {
|
||||
sexpr const & h = car(list);
|
||||
list = cdr(list);
|
||||
sexpr h = car(list);
|
||||
list = cdr(list);
|
||||
len += space_upto_line_break(h, available, found_newline);
|
||||
if (len > available)
|
||||
throw space_exceeded();
|
||||
|
|
Loading…
Reference in a new issue