mirror of
https://github.com/jketterl/openwebrx.git
synced 2026-01-27 10:54:15 +01:00
handle potentially invalid ascii characters
This commit is contained in:
parent
5a7a134024
commit
6ca8714fdd
|
|
@ -702,7 +702,7 @@ class DspManager(SdrSourceEventClient, ClientDemodulatorSecondaryDspEventClient)
|
|||
b = data.tobytes()
|
||||
# If we know it's not pickled, let us not unpickle
|
||||
if len(b) < 2 or b[0] != 0x80 or not 3 <= b[1] <= pickle.HIGHEST_PROTOCOL:
|
||||
callback(b.decode("ascii"))
|
||||
callback(b.decode("ascii", errors="replace"))
|
||||
return
|
||||
|
||||
io = BytesIO(b)
|
||||
|
|
@ -712,7 +712,7 @@ class DspManager(SdrSourceEventClient, ClientDemodulatorSecondaryDspEventClient)
|
|||
except EOFError:
|
||||
pass
|
||||
except pickle.UnpicklingError:
|
||||
callback(b.decode("ascii"))
|
||||
callback(b.decode("ascii", errors="replace"))
|
||||
|
||||
return unpickler
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue