[OpenSIPS-Devel] [OpenSIPS/opensips] 9fea57: cachedb_memcached: fix NULL deref when memcached_c...

Ravitez Dondeti noreply at github.com
Tue Apr 7 12:35:11 UTC 2026


  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 9fea57eeaf5c687f49a952692b2b7530ec66a7ee
      https://github.com/OpenSIPS/opensips/commit/9fea57eeaf5c687f49a952692b2b7530ec66a7ee
  Author: rdondeti <ravitez.dondeti at gmail.com>
  Date:   2026-04-07 (Tue, 07 Apr 2026)

  Changed paths:
    M modules/cachedb_memcached/cachedb_memcached.c

  Log Message:
  -----------
  cachedb_memcached: fix NULL deref when memcached_create() returns NULL

memcached_create(NULL) can return NULL on allocation failure.  The existing
code never checks the return value, so a NULL memc pointer falls through to
memcached_server_push(NULL, ...) which dereferences the NULL pointer.

Add an explicit NULL check after memcached_create(), following the existing
error-handling pattern in the function (pkg_free + return 0).

Found during a systematic audit of cachedb backends following the
cachedb_redis NULL-deref fix in commit 8fb569cb3.


  Commit: 8f959e73c79bf42d06ce2ee7406a80ab9edb8ca1
      https://github.com/OpenSIPS/opensips/commit/8f959e73c79bf42d06ce2ee7406a80ab9edb8ca1
  Author: rdondeti <ravitez.dondeti at gmail.com>
  Date:   2026-04-07 (Tue, 07 Apr 2026)

  Changed paths:
    M modules/cachedb_cassandra/cachedb_cassandra_dbase.c

  Log Message:
  -----------
  cachedb_cassandra: fix NULL deref when cass_cluster_new() returns NULL

cass_cluster_new() can return NULL on allocation failure.  The existing code
has a NULL check, but it comes after cass_cluster_set_credentials() already
uses the pointer (when credentials are configured), so a NULL return causes
a crash before the check is reached.

Move the NULL check to immediately after cass_cluster_new(), before any use
of the returned pointer.

Found during a systematic audit of cachedb backends following the
cachedb_redis NULL-deref fix in commit 8fb569cb3.


Compare: https://github.com/OpenSIPS/opensips/compare/82e242e30f2e...8f959e73c79b

To unsubscribe from these emails, change your notification settings at https://github.com/OpenSIPS/opensips/settings/notifications



More information about the Devel mailing list