1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

coverity 472863: cookies: length check order wrong

This commit is contained in:
Andy Green 2025-01-16 10:49:10 +00:00
parent 5a34404b1a
commit b81b24d10e

View file

@ -160,11 +160,13 @@ lws_cookie_rm_sws(const char **buf_p, size_t *len_p)
buf = *buf_p;
len = *len_p;
while (buf[0] == ' ' && len > 0) {
buf++;
len--;
}
while (buf[len - 1] == ' ' && len > 0)
while (len && buf[len - 1] == ' ')
len--;
*buf_p = buf;