summaryrefslogtreecommitdiff
path: root/cgi-bin/template.c
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2021-04-05 15:57:50 -0400
committerMichael R Sweet <michael.r.sweet@gmail.com>2021-04-05 15:57:50 -0400
commit064e50fb06e83e6c1756e2a81c2fcbd4d6fca8e6 (patch)
tree45145c8db9a634af861cb1ed87a7378837e72763 /cgi-bin/template.c
parent6918883fba4942931dc455b32545d6edf18dec5c (diff)
downloadcups-064e50fb06e83e6c1756e2a81c2fcbd4d6fca8e6.tar.gz
Import all of the bug fixes from the OpenPrinting CUPS repository.
Import the improvements to ippeveprinter from OpenPrinting/ippsample. Import the improvements to ippfind and ipptool from OpenPrinting/ippsample.
Diffstat (limited to 'cgi-bin/template.c')
-rw-r--r--cgi-bin/template.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cgi-bin/template.c b/cgi-bin/template.c
index 1972b4ae2..0b785b2f6 100644
--- a/cgi-bin/template.c
+++ b/cgi-bin/template.c
@@ -307,9 +307,9 @@ cgi_copy(FILE *out, /* I - Output file */
*/
if (name[1])
- sprintf(outval, "%d", cgiGetSize(name + 1));
+ snprintf(outval, sizeof(outval), "%d", cgiGetSize(name + 1));
else
- sprintf(outval, "%d", element + 1);
+ snprintf(outval, sizeof(outval), "%d", element + 1);
outptr = outval;
}
@@ -457,7 +457,7 @@ cgi_copy(FILE *out, /* I - Output file */
continue;
else if (ch == '#')
{
- sprintf(s, "%d", element + 1);
+ snprintf(s, sizeof(compare) - (size_t)(s - compare), "%d", element + 1);
s += strlen(s);
}
else if (ch == '{')
@@ -473,7 +473,7 @@ cgi_copy(FILE *out, /* I - Output file */
*innerptr = '\0';
if (innername[0] == '#')
- sprintf(s, "%d", cgiGetSize(innername + 1));
+ snprintf(s, sizeof(compare) - (size_t)(s - compare), "%d", cgiGetSize(innername + 1));
else if ((innerptr = strrchr(innername, '-')) != NULL &&
isdigit(innerptr[1] & 255))
{