Merge branch 'its10505' into 'master'

ITS#10505 lloadd: tighten msgid checking

See merge request openldap/openldap!879
This commit is contained in:
Ondřej Kuzník 2026-05-19 17:57:50 +00:00
commit 6d52bb55c9
2 changed files with 10 additions and 2 deletions

View file

@ -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 ) {

View file

@ -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;
}