Skip to content

Commit

Permalink
Merge pull request #1055 from paperino1983/fix_coverity_CID349582_REV…
Browse files Browse the repository at this point in the history
…ERSE_INULL

should fix *** CID 349582:  Null pointer dereferences  (REVERSE_INULL)
  • Loading branch information
bel2125 committed Apr 23, 2023
2 parents 55b81b0 + 2bdeaed commit 6ee7cda
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/civetweb.c
Expand Up @@ -12823,11 +12823,14 @@ dav_lock_file(struct mg_connection *conn, const char *path)
int i;
uint64_t LOCK_DURATION_NS =
(uint64_t)(LOCK_DURATION_S) * (uint64_t)1000000000;
struct twebdav_lock *dav_lock = conn->phys_ctx->webdav_lock;
struct twebdav_lock *dav_lock = NULL;

if (!path || !conn->dom_ctx || !conn->request_info.remote_user) {
if (!path || !conn
|| !conn->dom_ctx || !conn->request_info.remote_user || !conn->phys_ctx) {
return;
}

dav_lock = conn->phys_ctx->webdav_lock;
mg_get_request_link(conn, link_buf, sizeof(link_buf));

/* const char *refresh = mg_get_header(conn, "If"); */
Expand Down

0 comments on commit 6ee7cda

Please sign in to comment.