summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2016-10-14 10:26:22 (GMT)
committer Vincent Sanders <vince@kyllikki.org>2016-10-14 10:26:22 (GMT)
commit10277b8eb2229923ba48f2de0873eab1e5f24ece (patch)
treedb7bd41bdc6f4349cf7c3097f6e2cea57bd995a6
parent93be211644a69fd1832a10e0fdc896e92b264363 (diff)
downloadnsgenbind-10277b8eb2229923ba48f2de0873eab1e5f24ece.tar.gz
nsgenbind-10277b8eb2229923ba48f2de0873eab1e5f24ece.tar.bz2
use bounded string writing
-rw-r--r--src/duk-libdom-dictionary.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/duk-libdom-dictionary.c b/src/duk-libdom-dictionary.c
index 09e4379..8c80947 100644
--- a/src/duk-libdom-dictionary.c
+++ b/src/duk-libdom-dictionary.c
@@ -83,13 +83,13 @@ get_member_default_str(struct ir_entry *dictionarye,
case WEBIDL_NODE_TYPE_LITERAL_INT:
lit_int = webidl_node_getint(lit_node);
*defl_out = malloc(128);
- sprintf(*defl_out, "%d", *lit_int);
+ snprintf(*defl_out, 128, "%d", *lit_int);
break;
case WEBIDL_NODE_TYPE_LITERAL_FLOAT:
lit_flt = webidl_node_getfloat(lit_node);
*defl_out = malloc(128);
- sprintf(*defl_out, "%f", *lit_flt);
+ snprintf(*defl_out, 128, "%f", *lit_flt);
break;
default: