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 *end;
|
||||
int max_storage;
|
||||
|
||||
char finalized;
|
||||
};
|
||||
|
||||
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__);
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -3096,6 +3102,8 @@ lws_spa_finalize(struct lws_spa *spa)
|
|||
spa->s = NULL;
|
||||
}
|
||||
|
||||
spa->finalized = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue