mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
libwebsockets - gcc warnings
you have your makefiles set up to treat warnings as errors, and my gcc 4.4.5 (64 bit) compiler generates 3 warnings that need fixing: (that sprintf() one is a real bug.. if ext_name contains formatting characters you are looking at a potential segv). Signed-off-by: Patrick McManus <mcmanus@ducksong.com>
This commit is contained in:
parent
6c9395529e
commit
4bf91d7224
2 changed files with 5 additions and 4 deletions
|
@ -421,7 +421,7 @@ handshake_0405(struct libwebsocket *wsi)
|
|||
|
||||
if (ext_count)
|
||||
*p++ = ',';
|
||||
p += sprintf(p, ext_name);
|
||||
p += sprintf(p, "%s", ext_name);
|
||||
ext_count++;
|
||||
|
||||
/* instantiate the extension on this conn */
|
||||
|
|
|
@ -1187,8 +1187,9 @@ libwebsocket_service_fd(struct libwebsocket_context *context,
|
|||
NULL, &p, (pkt + sizeof(pkt)) - p - 12);
|
||||
|
||||
p += sprintf(p, "\x0d\x0a");
|
||||
|
||||
read(context->fd_random, p, 8);
|
||||
|
||||
if (libwebsockets_get_random(context, p, 8) != 8)
|
||||
return -1;
|
||||
memcpy(&challenge[8], p, 8);
|
||||
p += 8;
|
||||
|
||||
|
@ -1242,7 +1243,7 @@ libwebsocket_service_fd(struct libwebsocket_context *context,
|
|||
|
||||
if (ext_count)
|
||||
*p++ = ',';
|
||||
p += sprintf(p, ext->name);
|
||||
p += sprintf(p, "%s", ext->name);
|
||||
ext_count++;
|
||||
|
||||
ext++;
|
||||
|
|
Loading…
Add table
Reference in a new issue