Skip to content

Commit 7c2b7e9

Browse files
committed
fix compiler warning when passing empty string to oidc_util_html_escape
Signed-off-by: Hans Zandbelt <[email protected]>
1 parent 7faacc7 commit 7c2b7e9

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
09/13/2025
2+
- redis: apply global (server-wide) locking when system(!) environment variable
3+
OIDC_REDIS_MUTEX_GLOBAL is set, for backwards compatibility, through:
4+
PassEnv OIDC_REDIS_MUTEX_GLOBAL
5+
16
09/12/2025
27
- test: add util/*.c coverage tests
38

src/cache/redis.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@
4646
#include "cache/redis.h"
4747
#include "cfg/cfg_int.h"
4848

49-
// TODO: proper Redis error reporting (server unreachable etc.)
50-
5149
#define REDIS_CONNECT_TIMEOUT_DEFAULT 5
5250
#define REDIS_TIMEOUT_DEFAULT 5
5351
#define REDIS_KEEPALIVE_DEFAULT -1
5452

53+
#define OIDC_REDIS_MUTEX_GLOBAL_ENV_VAR "OIDC_REDIS_MUTEX_GLOBAL"
54+
5555
/* create the cache context */
5656
static oidc_cache_cfg_redis_t *oidc_cache_redis_cfg_create(apr_pool_t *pool) {
5757
oidc_cache_cfg_redis_t *context = apr_pcalloc(pool, sizeof(oidc_cache_cfg_redis_t));
58-
context->mutex = oidc_cache_mutex_create(pool, FALSE);
58+
context->mutex = oidc_cache_mutex_create(pool, getenv(OIDC_REDIS_MUTEX_GLOBAL_ENV_VAR) ? TRUE : FALSE);
5959
context->username = NULL;
6060
context->passwd = NULL;
6161
context->database = -1;

src/util/html.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ char *oidc_util_html_escape(apr_pool_t *pool, const char *s) {
6161
unsigned int m = 0;
6262
const char *ptr = chars;
6363
unsigned int len = _oidc_strlen(ptr);
64-
char *r = apr_pcalloc(pool, _oidc_strlen(s) * 6);
64+
char *r = apr_pcalloc(pool, _oidc_strlen(s) * 6 + 1);
6565
for (i = 0; i < _oidc_strlen(s); i++) {
6666
for (n = 0; n < len; n++) {
6767
if (s[i] == chars[n]) {

0 commit comments

Comments
 (0)