summaryrefslogtreecommitdiff
path: root/cmd/lib
diff options
context:
space:
mode:
authorKevin Jacobs <kjacobs@mozilla.com>2019-09-18 00:47:46 +0000
committerKevin Jacobs <kjacobs@mozilla.com>2019-09-18 00:47:46 +0000
commit9270b62339bf0716c4f94cca858e8bfed4ec708c (patch)
tree04ce2e5cbdc7ba95da32ecd21710368cd25c4862 /cmd/lib
parent2d4f7dc44adb24b2d5197afe46771dba8bcaceb0 (diff)
downloadnss-hg-9270b62339bf0716c4f94cca858e8bfed4ec708c.tar.gz
Bug 1581024 - Check for pointer wrap in derprint.c. r=jcj
Check for pointer wrap on output-length check in the derdump utility. Differential Revision: https://phabricator.services.mozilla.com/D46196
Diffstat (limited to 'cmd/lib')
-rw-r--r--cmd/lib/derprint.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/lib/derprint.c b/cmd/lib/derprint.c
index 08ef66d08..a7643be97 100644
--- a/cmd/lib/derprint.c
+++ b/cmd/lib/derprint.c
@@ -509,7 +509,7 @@ prettyPrintItem(FILE *out, const unsigned char *data, const unsigned char *end,
/*
* Just quit now if slen more bytes puts us off the end.
*/
- if ((data + slen) > end) {
+ if ((data + slen) < data || (data + slen) > end) {
PORT_SetError(SEC_ERROR_BAD_DER);
return -1;
}