github-code-scanning[bot] commented on code in PR #12076:
URL: https://github.com/apache/dolphinscheduler/pull/12076#discussion_r993760695


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UdfFuncServiceImpl.java:
##########
@@ -112,9 +120,15 @@
             return result;
         }
 
-        Resource resource = resourceMapper.selectById(resourceId);
-        if (resource == null) {
-            logger.error("Resource does not exist, resourceId:{}.", 
resourceId);
+        Boolean existResource = false;
+        try {
+            existResource = storageOperate.exists(fullName);
+        } catch (IOException e){
+            logger.error("AmazonServiceException when checking resource: " + 
fullName);
+        }
+
+        if (!existResource){
+            logger.error("resourceId {} is not exist", fullName);

Review Comment:
   ## Logging should not be vulnerable to injection attacks
   
   <!--SONAR_ISSUE_KEY:AYPNYBjwUAsZPIwYbSMr-->Change this code to not log 
user-controlled data. <p>See more on <a 
href="https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&issues=AYPNYBjwUAsZPIwYbSMr&open=AYPNYBjwUAsZPIwYbSMr&pullRequest=12076";>SonarCloud</a></p>
   
   [Show more 
details](https://github.com/apache/dolphinscheduler/security/code-scanning/1786)



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

Reply via email to