From: Ondřej Kuzník Date: Fri, 15 May 2026 12:12:44 +0000 (+0100) Subject: ITS#10505 lloadd: tighten msgid checking X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=aa4e389ed5b226276b595d59a37918984d43902c;p=thirdparty%2Fopenldap.git ITS#10505 lloadd: tighten msgid checking --- diff --git a/servers/lloadd/client.c b/servers/lloadd/client.c index 1d91e1c002..aaf48f3941 100644 --- a/servers/lloadd/client.c +++ b/servers/lloadd/client.c @@ -40,7 +40,8 @@ request_abandon( LloadConnection *c, LloadOperation *op ) op->o_res = LLOAD_OP_COMPLETED; - if ( ber_decode_int( &op->o_request, &needle.o_client_msgid ) ) { + if ( ber_decode_int( &op->o_request, &needle.o_client_msgid ) || + needle.o_client_msgid <= 0 ) { Debug( LDAP_DEBUG_STATS, "request_abandon: " "connid=%lu msgid=%d invalid integer sent in abandon request\n", c->c_connid, op->o_client_msgid ); @@ -50,6 +51,13 @@ request_abandon( LloadConnection *c, LloadOperation *op ) return -1; } + if ( op->o_client_msgid == needle.o_client_msgid ) { + Debug( LDAP_DEBUG_STATS, "request_abandon: " + "connid=%lu msgid=%d requests abandon of itself\n", + c->c_connid, op->o_client_msgid ); + goto done; + } + CONNECTION_LOCK(c); request = ldap_tavl_find( c->c_ops, &needle, operation_client_cmp ); if ( !request ) { diff --git a/servers/lloadd/operation.c b/servers/lloadd/operation.c index 3c66935056..14974e7fca 100644 --- a/servers/lloadd/operation.c +++ b/servers/lloadd/operation.c @@ -157,7 +157,7 @@ operation_init( LloadConnection *c, BerElement *ber ) goto fail; } - if ( !op->o_client_msgid ) { + if ( op->o_client_msgid <= 0 ) { goto fail; }