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; |
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) { |