From fc556ec2bc92a9d476c11406fad2c33db8bf7cb0 Mon Sep 17 00:00:00 2001 From: Yves-Alexis Perez Date: Mon, 1 Jun 2015 14:46:30 +0200 Subject: Imported Upstream version 5.3.1 --- src/libstrongswan/utils/enum.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/libstrongswan/utils/enum.c') diff --git a/src/libstrongswan/utils/enum.c b/src/libstrongswan/utils/enum.c index 089bebb79..1cead77ca 100644 --- a/src/libstrongswan/utils/enum.c +++ b/src/libstrongswan/utils/enum.c @@ -26,6 +26,10 @@ */ char *enum_to_name(enum_name_t *e, int val) { + if (!e) + { + return NULL; + } do { if (val >= e->first && val <= e->last) @@ -140,7 +144,7 @@ int enum_printf_hook(printf_hook_data_t *data, printf_hook_spec_t *spec, int val = *((int*)(args[1])); char *name, buf[512]; - if (ed->next == ENUM_FLAG_MAGIC) + if (ed && ed->next == ENUM_FLAG_MAGIC) { name = enum_flags_to_string(ed, val, buf, sizeof(buf)); if (name == NULL) -- cgit v1.2.3