@@ -211,7 +211,11 @@ public:
ParseBody();
if (form.empty()) return HTTP_STATUS_BAD_REQUEST;
}
- const hv::FormData& formdata = form[name];
+ auto iter = form.find(name);
+ if (iter == form.end()) {
+ return HTTP_STATUS_BAD_REQUEST;
+ }
+ const auto& formdata = iter->second;
if (formdata.content.empty()) {
return HTTP_STATUS_BAD_REQUEST;
@@ -92,7 +92,7 @@ protected:
has_mask = true;
int frame_size = ws_calc_frame_size(len, has_mask);
- if (sendbuf_.len < frame_size) {
+ if (sendbuf_.len < (size_t)frame_size) {
sendbuf_.resize(ceil2e(frame_size));
ws_build_frame(sendbuf_.base, buf, len, mask, has_mask, opcode, fin);