ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/src/vendor-crypto/openssl/dist/apps/asn1pars.c
(Generate patch)

Comparing vendor-crypto/openssl/dist/apps/asn1pars.c (file contents):
Revision 12144 by laffer1, Sat Dec 5 17:55:33 2015 UTC vs.
Revision 12145 by laffer1, Sat Jan 19 19:57:38 2019 UTC

# Line 295 | Line 295 | int MAIN(int argc, char **argv)
295              ASN1_TYPE *atmp;
296              int typ;
297              j = atoi(sk_OPENSSL_STRING_value(osk, i));
298 <            if (j == 0) {
298 >            if (j <= 0 || j >= tmplen) {
299                  BIO_printf(bio_err, "'%s' is an invalid number\n",
300                             sk_OPENSSL_STRING_value(osk, i));
301                  continue;
# Line 327 | Line 327 | int MAIN(int argc, char **argv)
327          num = tmplen;
328      }
329  
330 <    if (offset >= num) {
331 <        BIO_printf(bio_err, "Error: offset too large\n");
330 >    if (offset < 0 || offset >= num) {
331 >        BIO_printf(bio_err, "Error: offset out of range\n");
332          goto end;
333      }
334  
335      num -= offset;
336  
337 <    if ((length == 0) || ((long)length > num))
337 >    if (length == 0 || length > (unsigned int)num)
338          length = (unsigned int)num;
339      if (derout) {
340          if (BIO_write(derout, str + offset, length) != (int)length) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines