diff mbox series

pem: fix typo in a conditional in pem_next()

Message ID 20240222003549.786095-1-ram.subramanian@getcruise.com (mailing list archive)
State Accepted, archived
Headers show
Series pem: fix typo in a conditional in pem_next() | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-makedistcheck success Make Distcheck
prestwoj/iwd-ci-build success Build - Configure
prestwoj/iwd-ci-makecheckvalgrind success Make Check w/Valgrind
prestwoj/iwd-ci-clang success clang PASS
prestwoj/iwd-ci-makecheck success Make Check
prestwoj/iwd-ci-testrunner success test-runner PASS

Commit Message

Ram Subramanian Feb. 22, 2024, 12:35 a.m. UTC
This conditional is supposed to check if there is an extra (whitespace)
character after the ending boundary of the PEM. However, it does not
accomplish that goal as it is written because of a typo.
---
 ell/pem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Denis Kenzior Feb. 22, 2024, 2:49 p.m. UTC | #1
Hi Ram,

On 2/21/24 18:35, Ram Subramanian wrote:
> This conditional is supposed to check if there is an extra (whitespace)
> character after the ending boundary of the PEM. However, it does not
> accomplish that goal as it is written because of a typo.
> ---
>   ell/pem.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 

Nice catch.  Applied, thanks.

Regards,
-Denis
diff mbox series

Patch

diff --git a/ell/pem.c b/ell/pem.c
index 052e4c6..24e8372 100644
--- a/ell/pem.c
+++ b/ell/pem.c
@@ -148,7 +148,7 @@  const char *pem_next(const void *buf, size_t buf_len, char **type_label,
 				*base64_len = buf_ptr - base64_data;
 
 			if (endp) {
-				if (eol == buf + buf_len)
+				if (eol == buf_ptr + buf_len)
 					*endp = eol;
 				else
 					*endp = eol + 1;