Do not init slirp proxy when op_http_proxy is null
Fix the bug that would cause intermittent seg fault because previously slirp
proxy is always initialized.
BUG: 33174999
Change-Id: Ia96e5a8b4d1462bae132a37c6c1eaa3aac3e1172
Signed-off-by: Weilun Du <wdu@google.com>
diff --git a/android-qemu2-glue/proxy/slirp_proxy.cpp b/android-qemu2-glue/proxy/slirp_proxy.cpp
index da53263..c6098cc 100644
--- a/android-qemu2-glue/proxy/slirp_proxy.cpp
+++ b/android-qemu2-glue/proxy/slirp_proxy.cpp
@@ -106,6 +106,9 @@
}
bool qemu_android_setup_http_proxy(const char* http_proxy) {
+ if (!http_proxy) {
+ return true;
+ }
// Inject TCP proxy implementation into SLIRP stack.
// Initialization of the proxy will happen later.
static const SlirpProxyOps android_proxy_ops = {