1
0
Fork 0
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:
Andy Green 2020-08-30 09:30:36 +01:00
parent 40f7b84ff4
commit f53db84117
3 changed files with 16 additions and 5 deletions

View file

@ -519,8 +519,8 @@ lws_create_context(const struct lws_context_creation_info *info)
goto fail_event_libs;
#if defined(LWS_WITH_NETWORK)
size += plev->ops->evlib_size_ctx /* the ctx evlib priv */ +
(count_threads * plev->ops->evlib_size_pt) /* the pt evlib priv */;
size += (size_t)plev->ops->evlib_size_ctx /* the ctx evlib priv */ +
(count_threads * (size_t)plev->ops->evlib_size_pt) /* the pt evlib priv */;
lwsl_info("Event loop: %s\n", plev->ops->name);
#endif

View file

@ -535,11 +535,14 @@ static int
elops_init_vhost_listen_wsi_uv(struct lws *wsi)
{
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;
if (!wsi)
return 0;
w_read = &wsi_to_priv_uv(wsi)->w_read;
if (w_read->context)
return 0;

View file

@ -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);
if (lde->type == LDOT_DIR) {
#if !defined(WIN32) && !defined(_WIN32)
#if !defined(WIN32) && !defined(_WIN32) && !defined(__COVERITY__)
char dummy[8];
/*
* 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)
#endif