diff options
author | Jordan Augé <jordan.auge+fdio@cisco.com> | 2022-09-20 13:27:12 +0200 |
---|---|---|
committer | Jordan Augé <jordan.auge+fdio@cisco.com> | 2022-09-22 12:20:58 +0200 |
commit | bd26d18978861b24c5707dbaa24dac76133425e2 (patch) | |
tree | 7ff84df44d440254b48f800c368005eb27d4680d /ctrl/libhicnctrl/src/object.c | |
parent | 45da502db58f712b78e59c214f05c44aa01ea8d0 (diff) |
fix(libhicnctrl): fix new listener validation during face or connection creation
Change-Id: I5f532320fcb3fc01cd3a027af7ea5fc6425e4097
Ref: HICN-790
Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
Diffstat (limited to 'ctrl/libhicnctrl/src/object.c')
-rw-r--r-- | ctrl/libhicnctrl/src/object.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ctrl/libhicnctrl/src/object.c b/ctrl/libhicnctrl/src/object.c index 34f21509a..d9863308e 100644 --- a/ctrl/libhicnctrl/src/object.c +++ b/ctrl/libhicnctrl/src/object.c @@ -44,6 +44,12 @@ int hc_object_cmp(hc_object_type_t object_type, hc_object_t *object1, int hc_object_snprintf(char *s, size_t size, hc_object_type_t object_type, hc_object_t *object) { + if (!object) { + if (size == 0) return -1; + *s = '\0'; + return 1; + } + const hc_object_ops_t *vft = object_vft[object_type]; if (!vft) return -1; return vft->obj_snprintf(s, size, object); |