Jelajahi Sumber

xcap_server: init etag variable for PUT operations

- the function xcaps_get_db_etag() may not found a record to db and will
  not initialize it, resulting in bogus value passed to
  check_preconditions()
- reported by Juha Heinanen, FS#283
(cherry picked from commit 2d27dd1080cd490e93646b38d3912dcbe3761ca5)
Daniel-Constantin Mierla 12 tahun lalu
induk
melakukan
c7ef60e6c9
1 mengubah file dengan 3 tambahan dan 3 penghapusan
  1. 3 3
      modules/xcap_server/xcap_server.c

+ 3 - 3
modules/xcap_server/xcap_server.c

@@ -506,8 +506,8 @@ static int w_xcaps_put(sip_msg_t* msg, char* puri, char* ppath,
 	str uri;
 	str path;
 	str body = {0, 0};
-	str etag;
-	str etag_hdr;
+	str etag = {0, 0};
+	str etag_hdr = {0, 0};
 	str tbuf;
 	str nbuf = {0, 0};
 	str allow = {0, 0};
@@ -1069,7 +1069,7 @@ static int w_xcaps_get(sip_msg_t* msg, char* puri, char* ppath)
 	struct sip_uri turi;
 	str uri;
 	str path;
-	str etag;
+	str etag = {0, 0};
 	str body;
 	int ret = 0;
 	xcap_uri_t xuri;