[OpenSIPS-Devel] [OpenSIPS/opensips] 8fb569: cachedb_redis: fix NULL deref when redisConnect re...

Bogdan Andrei IANCU noreply at github.com
Tue Mar 10 09:50:55 UTC 2026


  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 8fb569cb37712742149183e57cbfad34d910e325
      https://github.com/OpenSIPS/opensips/commit/8fb569cb37712742149183e57cbfad34d910e325
  Author: Norm Brandinger <n.brandinger at gmail.com>
  Date:   2026-03-09 (Mon, 09 Mar 2026)

  Changed paths:
    M modules/cachedb_redis/cachedb_redis_dbase.c

  Log Message:
  -----------
  cachedb_redis: fix NULL deref when redisConnect returns NULL

redisConnect() and redisConnectWithTimeout() can return NULL on allocation
failure.  The existing check only handles ctx->err != REDIS_OK (non-NULL
ctx with error), so a NULL return falls through to redisSetTimeout(NULL, ...)
which dereferences the NULL pointer.

Add an explicit NULL check after the error-code check.

Also change the warned flag from char to int to avoid undefined behavior
on signed overflow after 127 connection-timeout warnings.


  Commit: f0f53a61504538909070335cd0b37b987f773d0a
      https://github.com/OpenSIPS/opensips/commit/f0f53a61504538909070335cd0b37b987f773d0a
  Author: Bogdan Andrei IANCU <bogdan at opensips.org>
  Date:   2026-03-10 (Tue, 10 Mar 2026)

  Changed paths:
    M modules/cachedb_redis/cachedb_redis_dbase.c

  Log Message:
  -----------
  Merge pull request #3842 from NormB/fix/cachedb-redis-null-deref

cachedb_redis: fix NULL deref when redisConnect returns NULL


Compare: https://github.com/OpenSIPS/opensips/compare/e912836d8bf4...f0f53a615045

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



More information about the Devel mailing list