summaryrefslogtreecommitdiff
path: root/modules/websocket
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-10-07 15:23:38 +0200
committerGitHub <noreply@github.com>2018-10-07 15:23:38 +0200
commit5676632a3bb8562b3346a3afba4069501365b35f (patch)
tree79c0d2f4a5378a97535e35df18533d09066b1033 /modules/websocket
parentcff89fc4e4f2ceb577b5f7a119d98cb22d41ea44 (diff)
parentd65afb2c7474f4f7b19aacc74dd3956ee491c60b (diff)
Merge pull request #22788 from Faless/warnings_fix
Some warnings fix
Diffstat (limited to 'modules/websocket')
-rw-r--r--modules/websocket/lws_client.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/websocket/lws_client.cpp b/modules/websocket/lws_client.cpp
index cd814760e6..b3e5f6ffab 100644
--- a/modules/websocket/lws_client.cpp
+++ b/modules/websocket/lws_client.cpp
@@ -80,9 +80,12 @@ Error LWSClient::connect_to_host(String p_host, String p_path, uint16_t p_port,
char hbuf[1024];
char pbuf[2048];
String addr_str = (String)addr;
- strncpy(abuf, addr_str.ascii().get_data(), 1024);
- strncpy(hbuf, p_host.utf8().get_data(), 1024);
- strncpy(pbuf, p_path.utf8().get_data(), 2048);
+ strncpy(abuf, addr_str.ascii().get_data(), 1023);
+ abuf[1023] = '\0';
+ strncpy(hbuf, p_host.utf8().get_data(), 1023);
+ hbuf[1023] = '\0';
+ strncpy(pbuf, p_path.utf8().get_data(), 2047);
+ pbuf[2047] = '\0';
i.context = context;
if (p_protocols.size() > 0)