fix crash in davql exec, if the server response can't be parsed

Mon, 09 May 2022 20:31:30 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Mon, 09 May 2022 20:31:30 +0200
changeset 738
b62ea7f31593
parent 737
1c75c0498520
child 739
bba6a6e221b4

fix crash in davql exec, if the server response can't be parsed

libidav/davqlexec.c file | annotate | diff | comparison | revisions
--- a/libidav/davqlexec.c	Mon Aug 09 19:01:02 2021 +0200
+++ b/libidav/davqlexec.c	Mon May 09 20:31:30 2022 +0200
@@ -627,7 +627,11 @@
             // propfind request successful, now parse the response
             char *url = "http://url/";
             PropfindParser *parser = create_propfind_parser(rpbuf, url);
-            // TODO: test if parser is null
+            if(!parser) {
+                result.status = -1;
+                break;
+            }
+            
             ResponseTag response;
             int r;
             while((r = get_propfind_response(parser, &response)) != 0) {

mercurial