Commit 42cc80bb authored by Julian Kranz's avatar Julian Kranz

Fixed heap overflow in readhex_hex_read()

- This addresses issue 4 (http://code.google.com/p/gdsl-toolkit/issues/detail?id=4)
parent a44b3fbb
......@@ -37,7 +37,7 @@ size_t readhex_hex_read(FILE *f, uint8_t **buffer) {
if(length_str == size_str)
break;
}
if(size_str + 1 > size) {
if(length + 1 > size) {
size *= 2;
*buffer = (uint8_t*)realloc(*buffer, size);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment