Media History: stored write-protected media removed when machine starts#6918
Merged
Conversation
Member
|
Because that's the intented usage, it's a prefix, similar to http:// or ftp://, not something intended to be used in the middle of a path. |
Member
|
Wait, I just noticed that I messed up in the implementation and you corrected it, thanks! |
| /* Do not relativize to root. */ | ||
| else if ((above2 != NULL) && (above3 != NULL) && !strnicmp(src, above2, strlen(above2))) | ||
| sprintf(temp, "../../%s%s", prefix, &src[strlen(above2)]); | ||
| sprintf(temp, "%s../../%s", prefix, &src[strlen(above2)]); |
Check failure
Code scanning / CodeQL
Unbounded write Critical
| /* Do not relativize to root. */ | ||
| else if ((above != NULL) && (above2 != NULL) && !strnicmp(src, above, strlen(above))) | ||
| sprintf(temp, "../%s%s", prefix, &src[strlen(above)]); | ||
| sprintf(temp, "%s../%s", prefix, &src[strlen(above)]); |
Check failure
Code scanning / CodeQL
Unbounded write Critical
| sprintf(temp, "%s../%s", prefix, &src[strlen(above)]); | ||
| else if (!strnicmp(src, exe_path, strlen(exe_path))) | ||
| sprintf(temp, "<exe_path>/%s%s", prefix, &src[strlen(exe_path)]); | ||
| sprintf(temp, "%s<exe_path>/%s", prefix, &src[strlen(exe_path)]); |
Check failure
Code scanning / CodeQL
Unbounded write Critical
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
write-protected media other than which located in the machine folder being removed by Media History Manager due to 'wp://' is not positioned at the beginning of stored path in the machine configuration file.
eg. stored as ../../wp://disk/floppy.img instead of wp://../../disk/floppy.img
all the codes expect the beginning 5 character to be 'wp://' for write-protected but not in the middle of the path string
Checklist
References
N/A