fix(util/sexpr/format): potential access memory violation

This commit is contained in:
Leonardo de Moura 2015-06-19 20:26:19 -07:00
parent accc9dc38b
commit 38394d85dd

View file

@ -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();