From 487cd8a301d8158c12e3c49ca1668b1a9c95e1f1 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 18 May 2011 17:47:03 -0500 Subject: [PATCH] libnm-util: fix possible crash passing in NULL secret flags --- libnm-util/nm-setting-vpn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libnm-util/nm-setting-vpn.c b/libnm-util/nm-setting-vpn.c index d3aac03049..d70ff547c3 100644 --- a/libnm-util/nm-setting-vpn.c +++ b/libnm-util/nm-setting-vpn.c @@ -377,7 +377,8 @@ get_secret_flags (NMSetting *setting, errno = 0; tmp = strtoul ((const char *) val, NULL, 10); if ((errno == 0) && (tmp <= NM_SETTING_SECRET_FLAGS_ALL)) { - *out_flags = (guint32) tmp; + if (out_flags) + *out_flags = (guint32) tmp; success = TRUE; } else { g_set_error (error,