mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-28 07:51:27 +00:00
Protect proxy against ill-formed server responses
This commit is contained in:
parent
68e57bbaa7
commit
91049c8af8
1 changed files with 7 additions and 1 deletions
|
@ -16,6 +16,8 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import traceback
|
||||||
import threading
|
import threading
|
||||||
import Queue
|
import Queue
|
||||||
|
|
||||||
|
@ -73,7 +75,11 @@ class NetworkProxy(util.DaemonThread):
|
||||||
continue
|
continue
|
||||||
if response is None:
|
if response is None:
|
||||||
break
|
break
|
||||||
self.process(response)
|
# Protect against ill-formed or malicious server responses
|
||||||
|
try:
|
||||||
|
self.process(response)
|
||||||
|
except:
|
||||||
|
traceback.print_exc(file=sys.stderr)
|
||||||
self.trigger_callback('stop')
|
self.trigger_callback('stop')
|
||||||
if self.network:
|
if self.network:
|
||||||
self.network.stop()
|
self.network.stop()
|
||||||
|
|
Loading…
Add table
Reference in a new issue