-
Notifications
You must be signed in to change notification settings - Fork 182
fix: Remove instances of undefined behavior #1652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
30d4076
0a06f30
3a0e37e
5aa8b13
051a0ba
12387ba
b799f89
ac4fd02
8eb3488
7740bbb
6fa719c
66fa3ff
a568e66
5599bd9
c05c254
4922e2e
6699081
701fc80
4860410
1dbaf6a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -146,7 +146,7 @@ void WriteSd0Magic(char* input, uint32_t chunkSize) { | |
| input[2] = '0'; | ||
| input[3] = 0x01; | ||
| input[4] = 0xFF; | ||
| *reinterpret_cast<uint32_t*>(input + 5) = chunkSize; // Write the integer to the character array | ||
| std::memcpy(&input[5], &chunkSize, sizeof(uint32_t)); // Write the integer to the character array | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this one is a bit harder to test, but ill send you a test case for it |
||
| } | ||
|
|
||
| bool CheckSd0Magic(std::istream& streamToCheck) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,6 +54,7 @@ struct AssetStream : std::istream { | |
| } | ||
|
|
||
| operator bool() { | ||
| // NEED TO FIX THIS | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if this is changed make sure to check files existing and not existing with both packed and unpacked clients |
||
| return reinterpret_cast<AssetMemoryBuffer*>(rdbuf())->m_Success; | ||
| } | ||
| }; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind-out.txt build/gnu-debug/MasterServer |
Uh oh!
There was an error while loading. Please reload this page.