ftp: avoid risk of reading uninitialized integers #5972
Closed
Conversation
If the received PASV response doesn't match the expected pattern, we could end up reading uninitialized integers for IP address and port number. Issue pointed out by muse.dev
Can't you use this initializer? |
Sorry I meant |
That's a C99 feature that didn't exist in C89. |
Wow that fact just destroyed my universe. Anyway then go ahead! |
Maybe write 0u instead of 0 though |
I could, but personally I often sort of "react" a little on the extra letter like that and I prefer to go without it if I can. For this, I don't see the need to emphasize in the constant that it is an unsigned value. zero is still zero. |
? No it's not and we use {0} elsewhere. It's fine either way though. |
hm okay, thanks, then I stand corrected! |
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.
If the received PASV response doesn't match the expected pattern, we
could end up reading uninitialized integers for IP address and port
number.
Issue pointed out by muse.dev