]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#10505 lloadd: tighten msgid checking
authorOndřej Kuzník <ondra@mistotebe.net>
Fri, 15 May 2026 12:12:44 +0000 (13:12 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 19 May 2026 17:57:46 +0000 (17:57 +0000)
servers/lloadd/client.c
servers/lloadd/operation.c

index 1d91e1c002e216920e483dd4a714c01d57650a8b..aaf48f3941db1f1d71ad6f8eff139ac454c3d897 100644 (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 ) {
index 3c66935056119e2ce32c2169cb77e4f6a5872900..14974e7fca2abd6dc2874a621596bcc17f4fbb1a 100644 (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;
     }