Skip to content

Commit

Permalink
Bug 1581024 - Fix pointer comparisons, a=bustage
Browse files Browse the repository at this point in the history
--HG--
extra : histedit_source : d19141c918c6469cf028e02e325e9b1acf4a9710%2C7bb35e7c3f2dc36d7dc684c6a6856644f6d8ea58
  • Loading branch information
martinthomson committed Sep 27, 2019
1 parent 295dcb1 commit a7f1ff5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/lib/derprint.c
Expand Up @@ -4,6 +4,8 @@
#include "secutil.h"
#include "secoid.h"

#include <stdint.h>

#ifdef __sun
extern int fprintf(FILE *strm, const char *format, ... /* args */);
extern int fflush(FILE *stream);
Expand Down Expand Up @@ -509,8 +511,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 (((unsigned long)data + slen) < (unsigned long)data ||
((unsigned long)data + slen) > (unsigned long)end) {
if (data > end || slen > (end - data)) {
PORT_SetError(SEC_ERROR_BAD_DER);
return -1;
}
Expand Down

0 comments on commit a7f1ff5

Please sign in to comment.