Fix possible segfault in proto smtp in split mode

srvdst is disabled in split mode, and srvdst.bev is null
master
Soner Tari 5 months ago
parent 828c1c3c69
commit a9fec35d42

@ -222,7 +222,11 @@ protosmtp_bev_eventcb_connected_dst(struct bufferevent *bev, pxy_conn_ctx_t *ctx
ctx->connected = 1;
bufferevent_enable(bev, EV_READ|EV_WRITE);
bufferevent_enable(ctx->srvdst.bev, EV_READ);
// srvdst is disabled in split mode, see prototcp_setup_dst()
if (ctx->srvdst.bev) {
bufferevent_enable(ctx->srvdst.bev, EV_READ);
}
if (ctx->proto == PROTO_SMTP) {
prototcp_enable_src(ctx);

Loading…
Cancel
Save