mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
coverity: plugins fixes
This commit is contained in:
parent
40f7b84ff4
commit
f53db84117
3 changed files with 16 additions and 5 deletions
|
@ -519,8 +519,8 @@ lws_create_context(const struct lws_context_creation_info *info)
|
||||||
goto fail_event_libs;
|
goto fail_event_libs;
|
||||||
|
|
||||||
#if defined(LWS_WITH_NETWORK)
|
#if defined(LWS_WITH_NETWORK)
|
||||||
size += plev->ops->evlib_size_ctx /* the ctx evlib priv */ +
|
size += (size_t)plev->ops->evlib_size_ctx /* the ctx evlib priv */ +
|
||||||
(count_threads * plev->ops->evlib_size_pt) /* the pt evlib priv */;
|
(count_threads * (size_t)plev->ops->evlib_size_pt) /* the pt evlib priv */;
|
||||||
|
|
||||||
lwsl_info("Event loop: %s\n", plev->ops->name);
|
lwsl_info("Event loop: %s\n", plev->ops->name);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -535,11 +535,14 @@ static int
|
||||||
elops_init_vhost_listen_wsi_uv(struct lws *wsi)
|
elops_init_vhost_listen_wsi_uv(struct lws *wsi)
|
||||||
{
|
{
|
||||||
struct lws_context_per_thread *pt;
|
struct lws_context_per_thread *pt;
|
||||||
struct lws_io_watcher_libuv *w_read = &wsi_to_priv_uv(wsi)->w_read;
|
struct lws_io_watcher_libuv *w_read;
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
if (!wsi)
|
if (!wsi)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
w_read = &wsi_to_priv_uv(wsi)->w_read;
|
||||||
|
|
||||||
if (w_read->context)
|
if (w_read->context)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
@ -265,11 +265,19 @@ lws_dir_rm_rf_cb(const char *dirpath, void *user, struct lws_dir_entry *lde)
|
||||||
lws_snprintf(path, sizeof(path), "%s%c%s", dirpath, csep, lde->name);
|
lws_snprintf(path, sizeof(path), "%s%c%s", dirpath, csep, lde->name);
|
||||||
|
|
||||||
if (lde->type == LDOT_DIR) {
|
if (lde->type == LDOT_DIR) {
|
||||||
#if !defined(WIN32) && !defined(_WIN32)
|
#if !defined(WIN32) && !defined(_WIN32) && !defined(__COVERITY__)
|
||||||
char dummy[8];
|
char dummy[8];
|
||||||
/*
|
/*
|
||||||
* hm... eg, recursive dir symlinks can show up a LDOT_DIR
|
* hm... eg, recursive dir symlinks can show up a LDOT_DIR
|
||||||
* here
|
* here. If it's a symlink, don't recurse into it.
|
||||||
|
*
|
||||||
|
* Notice we immediately discard dummy without looking in it.
|
||||||
|
* There is no way to get into trouble from its lack of NUL
|
||||||
|
* termination in dummy[]. We just wanted to know if it was
|
||||||
|
* a symlink at all.
|
||||||
|
*
|
||||||
|
* Hide this from Coverity since it flags any use of readlink()
|
||||||
|
* even if safe.
|
||||||
*/
|
*/
|
||||||
if (readlink(path, dummy, sizeof(dummy)) < 0)
|
if (readlink(path, dummy, sizeof(dummy)) < 0)
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue