diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2017-07-15 18:52:33 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-07-17 15:46:25 +0200 |
commit | b4e1c5296c171e24dce972d47f3953a7250662b8 (patch) | |
tree | 768669c61ddfac20e7007361b27b9193abcdf54e | |
parent | f51731fc0c68d7a564fda2f29b165d2552f05dab (diff) | |
download | gnutls-b4e1c5296c171e24dce972d47f3953a7250662b8.tar.gz |
parse_pem_cert_mem: fixed issue resulting to accessing past the input data
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-rw-r--r-- | lib/gnutls_x509.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c index 132be49dcc..7a78634bbd 100644 --- a/lib/gnutls_x509.c +++ b/lib/gnutls_x509.c @@ -518,9 +518,10 @@ parse_pem_cert_mem(gnutls_certificate_credentials_t res, /* now we move ptr after the pem header */ ptr++; + size--; + /* find the next certificate (if any) */ - size = input_cert_size - (ptr - input_cert); if (size > 0) { char *ptr3; @@ -533,6 +534,7 @@ parse_pem_cert_mem(gnutls_certificate_credentials_t res, sizeof(PEM_CERT_SEP2) - 1); ptr = ptr3; + size = input_cert_size - (ptr - input_cert); } else ptr = NULL; |