Skip to content

Commit b8d42d0

Browse files
committed
BUILD: stream: address null-deref build warnings at -Wextra
These warnings are caused by the improper use of stktable_data_ptr() whose result is not checked instead of using __stktable_data_ptr().
1 parent 21ff2c4 commit b8d42d0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/stream.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ static int process_sticking_rules(struct stream *s, struct channel *req, int an_
14411441

14421442
/* srv found in table */
14431443
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &ts->lock);
1444-
ptr = stktable_data_ptr(rule->table.t, ts, STKTABLE_DT_SERVER_ID);
1444+
ptr = __stktable_data_ptr(rule->table.t, ts, STKTABLE_DT_SERVER_ID);
14451445
node = eb32_lookup(&px->conf.used_server_id, stktable_data_cast(ptr, server_id));
14461446
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &ts->lock);
14471447
if (node) {
@@ -1568,8 +1568,8 @@ static int process_store_rules(struct stream *s, struct channel *rep, int an_bit
15681568
s->store[i].ts = NULL;
15691569

15701570
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
1571-
ptr = stktable_data_ptr(s->store[i].table, ts, STKTABLE_DT_SERVER_ID);
1572-
stktable_data_cast(ptr, server_id) = objt_server(s->target)->puid;
1571+
ptr = __stktable_data_ptr(s->store[i].table, ts, STKTABLE_DT_SERVER_ID);
1572+
stktable_data_cast(ptr, server_id) = __objt_server(s->target)->puid;
15731573
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
15741574
stktable_touch_local(s->store[i].table, ts, 1);
15751575
}

0 commit comments

Comments
 (0)