diff options
| author | beck <> | 2015-10-14 21:02:08 +0000 |
|---|---|---|
| committer | beck <> | 2015-10-14 21:02:08 +0000 |
| commit | 57db5484f01ee7355ac6c6ca5d03f2cf66ec2a99 (patch) | |
| tree | 1e4727f14becde549063eed9db6766a0e7728f7d /src/lib/libcrypto/objects/obj_dat.c | |
| parent | 7cf20683870e309249a72a4fad4d15f471d5189a (diff) | |
| download | openbsd-57db5484f01ee7355ac6c6ca5d03f2cf66ec2a99.tar.gz openbsd-57db5484f01ee7355ac6c6ca5d03f2cf66ec2a99.tar.bz2 openbsd-57db5484f01ee7355ac6c6ca5d03f2cf66ec2a99.zip | |
Ensure we don't write a 0 byte past end of the buffer in the error case.
ok bcook@ deraadt@
Diffstat (limited to 'src/lib/libcrypto/objects/obj_dat.c')
| -rw-r--r-- | src/lib/libcrypto/objects/obj_dat.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/objects/obj_dat.c b/src/lib/libcrypto/objects/obj_dat.c index 15c298e333..82ebb9b1d2 100644 --- a/src/lib/libcrypto/objects/obj_dat.c +++ b/src/lib/libcrypto/objects/obj_dat.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: obj_dat.c,v 1.31 2014/08/08 04:53:43 guenther Exp $ */ | 1 | /* $OpenBSD: obj_dat.c,v 1.32 2015/10/14 21:02:08 beck Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -574,7 +574,7 @@ OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name) | |||
| 574 | if (i == -1) | 574 | if (i == -1) |
| 575 | goto err; | 575 | goto err; |
| 576 | if (i >= buf_len) { | 576 | if (i >= buf_len) { |
| 577 | buf += buf_len; | 577 | buf += buf_len - 1; |
| 578 | buf_len = 0; | 578 | buf_len = 0; |
| 579 | } else { | 579 | } else { |
| 580 | buf += i; | 580 | buf += i; |
| @@ -586,7 +586,7 @@ OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name) | |||
| 586 | if (i == -1) | 586 | if (i == -1) |
| 587 | goto err; | 587 | goto err; |
| 588 | if (i >= buf_len) { | 588 | if (i >= buf_len) { |
| 589 | buf += buf_len; | 589 | buf += buf_len - 1; |
| 590 | buf_len = 0; | 590 | buf_len = 0; |
| 591 | } else { | 591 | } else { |
| 592 | buf += i; | 592 | buf += i; |
