From bfed0b8f320aa15d24da84ffe117d166a5b062bd Mon Sep 17 00:00:00 2001
From: Valery Kharseko <vharseko@3a-systems.ru>
Date: Mon, 27 Jul 2026 17:22:35 +0000
Subject: [PATCH] Fix java/tainted-arithmetic CodeQL alerts (#765)
---
opendj-server-legacy/src/main/java/org/opends/server/replication/common/CSN.java | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/common/CSN.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/common/CSN.java
index 24f2c04..0026223 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/common/CSN.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/common/CSN.java
@@ -13,6 +13,7 @@
*
* Copyright 2006-2009 Sun Microsystems, Inc.
* Portions Copyright 2013-2015 ForgeRock AS.
+ * Portions Copyright 2026 3A Systems, LLC.
*/
package org.opends.server.replication.common;
@@ -319,11 +320,11 @@
}
else if (csn1.seqnum != csn2.seqnum)
{
- return csn1.seqnum - csn2.seqnum;
+ return Integer.compare(csn1.seqnum, csn2.seqnum);
}
else
{
- return csn1.serverId - csn2.serverId;
+ return Integer.compare(csn1.serverId, csn2.serverId);
}
}
--
Gitblit v1.10.0