From 4716f5b48fe53fb51a96ef1ddc58d3618d270257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 11 Jun 2019 08:52:25 +0300 Subject: [PATCH] Fix buffer end pointer comparison in maxavro The buffer pointer can point to the end pointer if it is the last value in the buffer. --- avro/maxavro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avro/maxavro.c b/avro/maxavro.c index 9cf2e5aff..29cfb46f4 100644 --- a/avro/maxavro.c +++ b/avro/maxavro.c @@ -144,7 +144,7 @@ char* maxavro_read_string(MAXAVRO_FILE* file, size_t* size) if (maxavro_read_integer(file, &len)) { - if (file->buffer_ptr + len < file->buffer_end) + if (file->buffer_ptr + len <= file->buffer_end) { key = MXS_MALLOC(len + 1); if (key)