[PATCH] pem: fix typo in a conditional in pem_next()

Ram Subramanian <[email protected]> Wed, 21 Feb 2024 16:35:49 -0800
Newsgroups dev.linux.lists.ell
Message-ID <[email protected]>
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(-)

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;
-- 
2.43.2


-- 


*Confidentiality Note:* We care about protecting our proprietary 
information, confidential material, and trade secrets. This message may 
contain some or all of those things. Cruise will suffer material harm if 
anyone other than the intended recipient disseminates or takes any action 
based on this message. If you have received this message (including any 
attachments) in error, please delete it immediately and notify the sender 
promptly.