Commit a392dbc
committed
cachedb_redis: restore NULL check after redisConnect/redisConnectUnix
If hiredis returns NULL (OOM), the previous `ctx && ctx->err` guard
skipped the error branch and fell through to redisSetTimeout(ctx, ...),
causing a NULL-pointer dereference. Split into separate !ctx and
ctx->err checks so OOM is caught before any ctx dereference.
Reported-by: dondetir <dondetir@users.noreply.github.com>1 parent 16652c1 commit a392dbc
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
| |||
126 | 131 | | |
127 | 132 | | |
128 | 133 | | |
129 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
130 | 140 | | |
131 | 141 | | |
132 | 142 | | |
| |||
0 commit comments