You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think adding a simple check to the while loops that go over the string should avoid this situation. Basically, make sure we don't go past the end of the string.
For why, you can see in frame 1 of the backtrace, both str and i. Notice is that i is greater than the length of the string str, even with a null term included. Checking the third value passed to memmove(...), the function call where the segfault occurred, you can see that it would be passing -1 to a size_t.
"Stopping" at the end of the string should be fine, as this should result in the third value of memmove(...) being zero.
Note: Following functions might not expect an empty string, so there might be more to do.
Bug Report
iRODS Version, OS and Version
Main branch (working towards 4.3.2), Ubuntu 20.04 docker container
What did you try to do?
I tried to make a simple rule from memory, and ended up with the following
non.r
rule:Then ran the following command to invoke irule:
irule -F /tmp/non.r
Expected behavior
irule gets upset at the improper rule, logs a message if possible, and then exits with a non-zero code.
Observed behavior (including steps to reproduce, if applicable)
irule segfaults.
Following is some detailed information from the core dump:
Backtrace:
There is no info for frame 0.
Frame 1:
Frame 2:
The text was updated successfully, but these errors were encountered: