summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2009-08-09 19:25:29 +0400
committerH. Peter Anvin <hpa@zytor.com>2009-08-09 10:30:48 -0700
commit0a45cc8ce8ae3451a7cff45c3947dbc631f1ddad (patch)
tree82bc7c95605d4cf3e41559dc59c6a277a4600c2a
parentc9b2d2a8ecc754a5a5b6cf549c3fd45719650299 (diff)
downloadnasm-0a45cc8ce8ae3451a7cff45c3947dbc631f1ddad.tar.gz
disasm.c: eatbyte -- use snprintf to prevent potential buffer overflow
At moment we can't overrun buffer even if we would like to but better to stay on a safe side and use snprintf. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--disasm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/disasm.c b/disasm.c
index ec145be8..6a2554be 100644
--- a/disasm.c
+++ b/disasm.c
@@ -1553,7 +1553,7 @@ int32_t eatbyte(uint8_t *data, char *output, int outbufsize, int segsize)
}
if (str)
- strcpy(output, str);
+ snprintf(output, outbufsize, "%s", str);
return 1;
}