Skip to content

fix socket recv error being silently ignored#195

Merged
code-of-kpp merged 1 commit intopython-smpplib:masterfrom
emnoor:sock-read-fix
Apr 15, 2022
Merged

fix socket recv error being silently ignored#195
code-of-kpp merged 1 commit intopython-smpplib:masterfrom
emnoor:sock-read-fix

Conversation

@emnoor
Copy link
Contributor

@emnoor emnoor commented Apr 15, 2022

if not raw_pdu:
raise exceptions.ConnectionError()

raw_pdu can never be "falsy" as it was already tested above:

if not raw_len:
raise exceptions.ConnectionError()

So this if-condition is never satisfied and the socket recv error is silently passed. It could potentially corrupt further recvs.

@code-of-kpp code-of-kpp merged commit 9ca29cf into python-smpplib:master Apr 15, 2022
@code-of-kpp
Copy link
Member

Thanks, @emnoor! I really admire this catch

@emnoor emnoor deleted the sock-read-fix branch April 15, 2022 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants