diff options
author | Ed Beroset <beroset@mindspring.com> | 2004-12-15 18:27:21 +0000 |
---|---|---|
committer | Ed Beroset <beroset@mindspring.com> | 2004-12-15 18:27:21 +0000 |
commit | 602f1df356d8ca6b8664f8b4728e6fcd162763b3 (patch) | |
tree | 61aa9de428972e30d89ab06e51c5f7b79f104b41 /ndisasm.c | |
parent | b30ff1f2846e709e86896517f93ceed9de2f69e3 (diff) | |
download | nasm-602f1df356d8ca6b8664f8b4728e6fcd162763b3.tar.gz nasm-602f1df356d8ca6b8664f8b4728e6fcd162763b3.tar.bz2 nasm-602f1df356d8ca6b8664f8b4728e6fcd162763b3.zip |
added buffer length parameter to prevent vulnerability to buffer
overflow exploits.
Diffstat (limited to 'ndisasm.c')
-rw-r--r-- | ndisasm.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -243,10 +243,10 @@ int main(int argc, char **argv) nextsync = next_sync (offset, &synclen); } while (p > q && (p - q >= INSN_MAX || lenread == 0)) { - lendis = disasm (q, outbuf, bits, offset, autosync, prefer); + lendis = disasm (q, outbuf, sizeof(outbuf), bits, offset, autosync, prefer); if (!lendis || lendis > (p - q) || (unsigned long)lendis > nextsync-offset) - lendis = eatbyte (q, outbuf); + lendis = eatbyte (q, outbuf, sizeof(outbuf)); output_ins (offset, q, lendis, outbuf); q += lendis; offset += lendis; |