summaryrefslogtreecommitdiff
path: root/passes/abc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-03-11 13:09:01 +0100
committerClifford Wolf <clifford@clifford.at>2014-03-11 13:09:01 +0100
commitfa75c8286e066ba4b73da94068662834cb671640 (patch)
treeb274b74730eaaeb8f9c1bbf0f0ef838417faccd1 /passes/abc
parentbada3ee815c05933723a64234106ab68b7599568 (diff)
Fixed memory corruption in passes/abc/blifparse.cc
Diffstat (limited to 'passes/abc')
-rw-r--r--passes/abc/blifparse.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/passes/abc/blifparse.cc b/passes/abc/blifparse.cc
index 2d46d1a8..1d4da19a 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)