You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2023/01/20 04:16:34 UTC

[GitHub] [dolphinscheduler] github-code-scanning[bot] commented on a diff in pull request #13435: [Fix-13434][Resource Center] fix the NPE when use OSS as the resource center

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


##########
dolphinscheduler-storage-plugin/dolphinscheduler-storage-s3/src/main/java/org/apache/dolphinscheduler/plugin/storage/s3/S3StorageOperator.java:
##########
@@ -431,7 +433,7 @@
 
                 storageEntityList.addAll(tempList);
             } catch (AmazonServiceException e) {
-                logger.error("Resource path: {}", pathToExplore, e);
+                logger.error("error while listing files status recursively, path: {}", pathToExplore, e);

Review Comment:
   ## Log Injection
   
   This log entry depends on a [user-provided value](1).
   This log entry depends on a [user-provided value](2).
   
   [Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/2590)



##########
dolphinscheduler-storage-plugin/dolphinscheduler-storage-s3/src/main/java/org/apache/dolphinscheduler/plugin/storage/s3/S3StorageOperator.java:
##########
@@ -585,16 +587,12 @@
      * a directory is a path ending with "/"
      */
     private String findDirAlias(String myStr) {
-        if (!myStr.endsWith("/")) {
+        if (!myStr.endsWith(FOLDER_SEPARATOR)) {
             // Make sure system won't crush down if someone accidentally misuse the function.
             return myStr;
         }
-        int lastIndex = myStr.lastIndexOf("/");
-        String subbedString = myStr.substring(0, lastIndex);
-        int secondLastIndex = subbedString.lastIndexOf("/");
-        StringBuilder stringBuilder = new StringBuilder();
-        stringBuilder.append(myStr, secondLastIndex + 1, lastIndex + 1);
 
-        return stringBuilder.toString();
+        Path path = Paths.get(myStr);

Review Comment:
   ## Uncontrolled data used in path expression
   
   This path depends on a [user-provided value](1).
   This path depends on a [user-provided value](2).
   This path depends on a [user-provided value](3).
   This path depends on a [user-provided value](4).
   This path depends on a [user-provided value](5).
   This path depends on a [user-provided value](6).
   
   [Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/2588)



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org