From: Clifford Wolf Date: Tue, 11 Mar 2014 12:09:01 +0000 (+0100) Subject: Fixed memory corruption in passes/abc/blifparse.cc X-Git-Tag: yosys-0.3.0~67 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fa75c8286e066ba4b73da94068662834cb671640;p=yosys.git Fixed memory corruption in passes/abc/blifparse.cc --- diff --git a/passes/abc/blifparse.cc b/passes/abc/blifparse.cc index 2d46d1a8e..1d4da19ad 100644 --- a/passes/abc/blifparse.cc +++ b/passes/abc/blifparse.cc @@ -40,7 +40,7 @@ static bool read_next_line(char *&buffer, size_t &buffer_size, int &line_count, } if (buffer_len == 0 || buffer[buffer_len-1] == '\\') { - if (buffer[buffer_len-1] == '\\') + if (buffer_len > 0 && buffer[buffer_len-1] == '\\') buffer[--buffer_len] = 0; line_count++; if (fgets(buffer+buffer_len, buffer_size-buffer_len, f) == NULL)