libstl: check string iterator limit before access in foug_stl_get_format()

This commit is contained in:
Hugues Delorme 2014-02-11 11:14:49 +01:00
parent 35e479bc28
commit 6f1d3ac97e

View File

@ -42,7 +42,7 @@ foug_stl_format_t foug_stl_get_format(foug_stream_t *stream, size_t data_size)
{ {
/* Skip spaces at beginning */ /* Skip spaces at beginning */
size_t pos = 0; size_t pos = 0;
while (isspace(fixed_buffer[pos]) && pos < read_size) while (pos < read_size && isspace(fixed_buffer[pos]))
++pos; ++pos;
/* Next token (if exists) must match "solid " */ /* Next token (if exists) must match "solid " */