mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-23 00:00:06 +01:00
spa: reject junk after finalization
This commit is contained in:
parent
629e356bb2
commit
311e3a585d
1 changed files with 8 additions and 0 deletions
|
@ -2952,6 +2952,8 @@ struct lws_spa {
|
||||||
char *storage;
|
char *storage;
|
||||||
char *end;
|
char *end;
|
||||||
int max_storage;
|
int max_storage;
|
||||||
|
|
||||||
|
char finalized;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -3067,6 +3069,10 @@ lws_spa_process(struct lws_spa *ludspa, const char *in, int len)
|
||||||
lwsl_err("%s: NULL spa\n", __func__);
|
lwsl_err("%s: NULL spa\n", __func__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
/* we reject any junk after the last part arrived and we finalized */
|
||||||
|
if (ludspa->finalized)
|
||||||
|
return 0;
|
||||||
|
|
||||||
return lws_urldecode_s_process(ludspa->s, in, len);
|
return lws_urldecode_s_process(ludspa->s, in, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3096,6 +3102,8 @@ lws_spa_finalize(struct lws_spa *spa)
|
||||||
spa->s = NULL;
|
spa->s = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spa->finalized = 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue