summaryrefslogtreecommitdiff
path: root/ext/standard/pack.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/pack.c')
-rw-r--r--ext/standard/pack.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/standard/pack.c b/ext/standard/pack.c
index 9946469473..569266ea1a 100644
--- a/ext/standard/pack.c
+++ b/ext/standard/pack.c
@@ -644,10 +644,10 @@ PHP_FUNCTION(unpack)
if (arg != 1 || namelen == 0) {
/* Need to add element number to name */
- sprintf(n, "%.*s%d", namelen, name, i + 1);
+ snprintf(n, sizeof(n), "%.*s%d", namelen, name, i + 1);
} else {
/* Truncate name to next format code or end of string */
- sprintf(n, "%.*s", namelen, name);
+ snprintf(n, sizeof(n), "%.*s", namelen, name);
}
if (size != 0 && size != -1 && INT_MAX - size + 1 < inputpos) {