fixes crash when using invalid namespace prefix

Thu, 03 Aug 2017 11:43:04 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Thu, 03 Aug 2017 11:43:04 +0200
changeset 269
c89633916e36
parent 268
2610eecfc5e5
child 270
0edfb4c0e7f8

fixes crash when using invalid namespace prefix

libidav/resource.c file | annotate | diff | comparison | revisions
--- a/libidav/resource.c	Thu Aug 03 11:38:41 2017 +0200
+++ b/libidav/resource.c	Thu Aug 03 11:43:04 2017 +0200
@@ -405,10 +405,16 @@
     char *pns;
     char *pname;
     dav_get_property_namespace_str(res->session->context, name, &pns, &pname);
+    if(!pns || !pname) {
+        return NULL;
+    }
     return dav_get_property_ns(res, pns, pname);
 }
 
 char* dav_get_property_ns(DavResource *res, char *ns, char *name) {
+    if(!ns || !name) {
+        return NULL;
+    }
     char *property = resource_get_property(res, ns, name);
     DavResourceData *data = res->data;
     // resource_get_property only returns persistent properties

mercurial