~martijnbraam/public-inbox

kmsg parsing: skip flag field and don't crash if it's missing v1 PROPOSED

Adam Mizerski: 1
 kmsg parsing: skip flag field and don't crash if it's missing

 1 files changed, 1 insertions(+), 12 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~martijnbraam/public-inbox/patches/54550/mbox | git am -3
Learn more about email & git

[PATCH] kmsg parsing: skip flag field and don't crash if it's missing Export this patch

---
 main.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/main.c b/main.c
index b477e1a..dd1ab8b 100644
--- a/main.c
+++ b/main.c
@@ -335,18 +335,7 @@ parse_kmsg_line(char *buffer, ssize_t size)
	end = NULL;
	long ts = strtol(buffer, &end, 10);
	if (end && end > buffer) {
		buffer = end + 1;
	}

	long flags = 0;
	if (buffer[0] == '-') {
		buffer += 1;
	} else {
		end = NULL;
		flags = strtol(buffer, &end, 10);
		if (end && end > buffer) {
			buffer = end;
		}
		buffer = end;
	}

	while (*buffer != ';') {
-- 
2.46.0