From 6f1d3ac97ed528fc72d35980da67ab6601ee0651 Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Tue, 11 Feb 2014 11:14:49 +0100 Subject: [PATCH] libstl: check string iterator limit before access in foug_stl_get_format() --- src/libstl/stl_format.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstl/stl_format.c b/src/libstl/stl_format.c index 32e0622..d7fac89 100644 --- a/src/libstl/stl_format.c +++ b/src/libstl/stl_format.c @@ -42,7 +42,7 @@ foug_stl_format_t foug_stl_get_format(foug_stream_t *stream, size_t data_size) { /* Skip spaces at beginning */ size_t pos = 0; - while (isspace(fixed_buffer[pos]) && pos < read_size) + while (pos < read_size && isspace(fixed_buffer[pos])) ++pos; /* Next token (if exists) must match "solid " */