github-advanced-security[bot] commented on code in PR #19830:
URL: https://github.com/apache/druid/pull/19830#discussion_r3936853906


##########
extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:
##########
@@ -71,6 +73,17 @@
   private static final String PROPERTIES_COL = "properties";
   private static final String COLUMNS_COL = "columns";
 
+  /**
+   * The version for a row being written: the current time, but strictly after 
{@code lastVersion}, which is the
+   * version the writer read ({@code 0} when there is none, as for a new row). 
The version doubles as the
+   * compare-and-set token and as the cache's ordering key, so it must 
actually advance on every write, even when two
+   * writes land in the same millisecond.
+   */
+  private static long nextVersion(long lastVersion)
+  {
+    return Math.max(System.currentTimeMillis(), lastVersion + 1);

Review Comment:
   ## CodeQL / User-controlled data in arithmetic expression
   
   This arithmetic expression depends on a [user-provided value](1), 
potentially causing an overflow.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/11933)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to