spa: reject junk after finalization

This commit is contained in:
Andy Green 2017-03-23 19:30:12 +08:00
parent 629e356bb2
commit 311e3a585d

View file

@ -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;
}