Andrew Geissler | c723b72 | 2021-01-08 16:14:09 -0600 | [diff] [blame] | 1 | From 277e1eca67fcc23cb31be7b826d83a19d9b89bd2 Mon Sep 17 00:00:00 2001 |
| 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> |
| 3 | Date: Tue, 22 Dec 2020 10:30:54 +0000 |
| 4 | Subject: [PATCH] pem.c: do not use rawmemchr() |
| 5 | |
| 6 | This is a glibc-only function, and causes build failures with |
| 7 | alternative libc implementations such as musl. |
| 8 | |
| 9 | Upstream-Status: Pending |
| 10 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
| 11 | --- |
| 12 | ell/pem.c | 2 +- |
| 13 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 14 | |
| 15 | diff --git a/ell/pem.c b/ell/pem.c |
| 16 | index 790f2c2..237ae02 100644 |
| 17 | --- a/ell/pem.c |
| 18 | +++ b/ell/pem.c |
| 19 | @@ -224,7 +224,7 @@ static uint8_t *pem_load_buffer(const void *buf, size_t buf_len, |
| 20 | |
| 21 | /* Check that each header line has a key and a colon */ |
| 22 | while (start < end) { |
| 23 | - const char *lf = rawmemchr(start, '\n'); |
| 24 | + const char *lf = memchr(start, '\n', end - start); |
| 25 | const char *colon = memchr(start, ':', lf - start); |
| 26 | |
| 27 | if (!colon) |