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:
parent
5a34404b1a
commit
b81b24d10e
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue