Skip to content

Commit fc12f28

Browse files
committed
Check url size limit.
1 parent 33ca65e commit fc12f28

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

easywsclient.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@ easywsclient::WebSocket::pointer from_url(/service/std::string url, bool useMask) {
364364
char host[128];
365365
int port;
366366
char path[128];
367+
if (url.size() >= 128) {
368+
fprintf(stderr, "ERROR: url size limit exceeded: %s\n", url.c_str());
369+
return NULL;
370+
}
367371
if (false) { }
368372
else if (sscanf(url.c_str(), "ws://%[^:/]:%d/%s", host, &port, path) == 3) {
369373
}

0 commit comments

Comments
 (0)