summaryrefslogtreecommitdiff
path: root/cmd/signtool/javascript.c
diff options
context:
space:
mode:
authorMartin Thomson <martin.thomson@gmail.com>2018-02-14 18:46:10 +1100
committerMartin Thomson <martin.thomson@gmail.com>2018-02-14 18:46:10 +1100
commit61cc1fa706af88f1159f5089840b09e2b838d0f4 (patch)
tree0de9959927f7108c6d6a4c378c641dbf071b13aa /cmd/signtool/javascript.c
parenta63322e39baae7b4c7f1f343891315973006493e (diff)
downloadnss-hg-61cc1fa706af88f1159f5089840b09e2b838d0f4.tar.gz
Bug 1309068 - Enable -Wshadow, r=franziskus
Diffstat (limited to 'cmd/signtool/javascript.c')
-rw-r--r--cmd/signtool/javascript.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/cmd/signtool/javascript.c b/cmd/signtool/javascript.c
index ffff2db59..58869aa61 100644
--- a/cmd/signtool/javascript.c
+++ b/cmd/signtool/javascript.c
@@ -1300,7 +1300,6 @@ extract_js(char *filename)
* Now we have a stream of tags and text. Go through and deal with each.
*/
for (curitem = head; curitem; curitem = curitem->next) {
- TagItem *tagp = NULL;
AVPair *pairp = NULL;
char *src = NULL, *id = NULL, *codebase = NULL;
PRBool hasEventHandler = PR_FALSE;
@@ -1669,11 +1668,14 @@ loser:
* Returns PR_SUCCESS if the directory is present, PR_FAILURE otherwise.
*/
static PRStatus
-ensureExists(char *base, char *path)
+ensureExists(char *basepath, char *path)
{
char fn[FNSIZE];
PRDir *dir;
- sprintf(fn, "%s/%s", base, path);
+ int c = snprintf(fn, sizeof(fn), "%s/%s", basepath, path);
+ if (c >= sizeof(fn)) {
+ return PR_FAILURE;
+ }
/*PR_fprintf(outputFD, "Trying to open directory %s.\n", fn);*/