This patch fixes the handling of a weak-linked
variable and should fix issue #8095.
diff --git a/Mac/Modules/_scproxy.c b/Mac/Modules/_scproxy.c
index 003f6a4..9f4c1a4 100644
--- a/Mac/Modules/_scproxy.c
+++ b/Mac/Modules/_scproxy.c
@@ -64,13 +64,18 @@
result = PyDict_New();
if (result == NULL) goto error;
- aNum = CFDictionaryGetValue(proxyDict,
+ if (&kSCPropNetProxiesExcludeSimpleHostnames != NULL) {
+ aNum = CFDictionaryGetValue(proxyDict,
kSCPropNetProxiesExcludeSimpleHostnames);
- if (aNum == NULL) {
- v = PyBool_FromLong(0);
- } else {
- v = PyBool_FromLong(cfnum_to_int32(aNum));
+ if (aNum == NULL) {
+ v = PyBool_FromLong(1);
+ } else {
+ v = PyBool_FromLong(cfnum_to_int32(aNum));
+ }
+ } else {
+ v = PyBool_FromLong(1);
}
+
if (v == NULL) goto error;
r = PyDict_SetItemString(result, "exclude_simple", v);