llphxd opened a new issue, #18345:
URL: https://github.com/apache/dolphinscheduler/issues/18345

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### What happened
   
   I found a potential bug in `OSUtils#getUserListFromWindows`.
   
   When parsing the output of the Windows `net user` command, the inner loop 
uses the outer loop index `i` instead of the inner loop index `j`:
   
   ```java
   for (int j = 0; j < lines[i].length(); j++) {
       if (lines[i].charAt(i) == '-') {
           count++;
       }
   }
   ```
   This means the code repeatedly checks the same character instead of checking 
each character in the current line.
   
   ### What you expected to happen
   
   The code should check each character in the current line to determine 
whether the line is the separator line made up of - characters:
   
   ### How to reproduce
   
   I found this issue by code inspection, not from a runtime failure.
   The affected logic is in:
   
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java
   
   ### Anything else
   
   _No response_
   
   ### Version
   
   dev
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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