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


##########
processing/src/main/java/org/apache/druid/math/expr/Function.java:
##########
@@ -2802,14 +2796,14 @@
 
       if (index < arg.length()) {
         if (length >= 0) {
-          return ExprEval.of(arg.substring(index, Math.min(index + length, 
arg.length())));
+          return ExprEval.ofString(arg.substring(index, Math.min(index + 
length, arg.length())));

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



##########
processing/src/main/java/org/apache/druid/math/expr/Function.java:
##########
@@ -4616,22 +4595,19 @@
       long precision = 2;
       if (args.size() > 1) {
         ExprEval precisionParam = args.get(1).eval(bindings);
+        if (precisionParam.value() == null) {
+          throw validationFailed("needs a LONG as its second argument but got 
null", precisionParam.type());

Review Comment:
   ## Unused format argument
   
   This format call refers to 0 argument(s) but supplies 1 argument(s).
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/10304)



-- 
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