rufimelo/DeltaSecommits huggingface dataset:
Vulnerability: A heap use-after-free flaw was found in curl versions from 7.59.0 through 7.61.1 in the code related to closing an easy handle. When closing and cleaning up an 'easy' handle in the `Curl_close()` function, the library code first frees a struct (without nulling the pointer) and might then subsequently erroneously write to a struct field within that already freed struct.
Vulnerability ID: CVE-2018-16840
CWE: CWE-416
Severity score: 6.4
Project: https://github.com/curl/curl
Published: 2018-10-31
File: lib/url.c
Commit message: Curl_close: clear data->multi_easy on free to avoid use-after-free

Regression from b46cfbc068 (7.59.0)
CVE-2018-16840
Reported-by: Brian Carpenter (Geeknik Labs)

Bug: https://curl.haxx.se/docs/CVE-2018-16840.html
Commit author: Daniel Stenberg

Vulnerable version (before fix):
 CURLcode Curl_close(struct Curl_easy *data)        and detach this handle from there. */     curl_multi_remove_handle(data->multi, data);    if(data->multi_easy)     /* when curl_easy_perform() is used, it creates its own multi handle to        use and this is the one */     curl_multi_cleanup(data->multi_easy);    /* Destroy the timeout list that is held in the easy handle. It is      /normally/ done by curl_multi_remove_handle() but this is "just in

Fixed version (after fix):
 CURLcode Curl_close(struct Curl_easy *data)        and detach this handle from there. */     curl_multi_remove_handle(data->multi, data);    if(data->multi_easy) {     /* when curl_easy_perform() is used, it creates its own multi handle to        use and this is the one */     curl_multi_cleanup(data->multi_easy);     data->multi_easy = NULL;   }    /* Destroy the timeout list that is held in the easy handle. It is      /normally/ done by curl_multi_remove_handle() but this is "just in

Patch:
patch: @@ -331,10 +331,12 @@ CURLcode Curl_close(struct Curl_easy *data)
        and detach this handle from there. */
     curl_multi_remove_handle(data->multi, data);
 
-  if(data->multi_easy)
+  if(data->multi_easy) {
     /* when curl_easy_perform() is used, it creates its own multi handle to
        use and this is the one */
     curl_multi_cleanup(data->multi_easy);
+    data->multi_easy = NULL;
+  }
 
   /* Destroy the timeout list that is held in the easy handle. It is
      /normally/ done by curl_multi_remove_handle() but this is "just in
path: lib/url.c
Vulnerability: Curl versions 7.14.1 through 7.61.1 are vulnerable to a heap-based buffer over-read in the tool_msgs.c:voutf() function that may result in information exposure and denial of service.
Vulnerability ID: CVE-2018-16842
CWE: CWE-125
Severity score: 4.9
Project: https://github.com/curl/curl
Published: 2018-10-31
File: src/tool_msgs.c
Commit message: voutf: fix bad arethmetic when outputting warnings to stderr

CVE-2018-16842
Reported-by: Brian Carpenter
Bug: https://curl.haxx.se/docs/CVE-2018-16842.html
Commit author: Daniel Stenberg

Vulnerable version (before fix):
 static void voutf(struct GlobalConfig *config,         (void)fwrite(ptr, cut + 1, 1, config->errors);         fputs("\n", config->errors);         ptr += cut + 1; /* skip the space too */         len -= cut;       }       else {         fputs(ptr, config->errors);

Fixed version (after fix):
 static void voutf(struct GlobalConfig *config,         (void)fwrite(ptr, cut + 1, 1, config->errors);         fputs("\n", config->errors);         ptr += cut + 1; /* skip the space too */         len -= cut + 1;       }       else {         fputs(ptr, config->errors);

Patch:
patch: @@ -67,7 +67,7 @@ static void voutf(struct GlobalConfig *config,
         (void)fwrite(ptr, cut + 1, 1, config->errors);
         fputs("\n", config->errors);
         ptr += cut + 1; /* skip the space too */
-        len -= cut;
+        len -= cut + 1;
       }
       else {
         fputs(ptr, config->errors);
path: src/tool_msgs.c
Vulnerability: An issue was discovered in Elefant CMS before 2.0.7. There is a PHP Code Execution Vulnerability in /designer/add/stylesheet.php by using a .php extension in the New Stylesheet Name field in conjunction with <?php content, because of insufficient input validation in apps/designer/handlers/csspreview.php.
Vulnerability ID: CVE-2018-16975
CWE: CWE-94
Severity score: 6.4
Project: https://github.com/jbroadway/elefant
Published: 2018-09-12
File: apps/designer/handlers/csspreview.php
Commit message: Fixed CSS preview including PHP tags, re: #286
Commit author: lux

Vulnerable version (before fix):
 		} 	} 	if ($_GET['css'] && preg_match ('/^(layouts|css)\/[a-z0-9\/ _-]+\.css$/i', $_GET['css'])) { 		$page->layout = str_replace ('</head>', '<style>' . file_get_contents ($_GET['css']) . '</style></head>', $page->layout); 	} } else { 	if (! empty ($_POST['layout'])) { 		} 	} 	if ($_POST['css']) { 		$page->layout = str_replace ('</head>', '<style>' . $_POST['css'] . '</style></head>', $page->layout); 	}	 } 

Fixed version (after fix):
 		} 	} 	if ($_GET['css'] && preg_match ('/^(layouts|css)\/[a-z0-9\/ _-]+\.css$/i', $_GET['css'])) { 		$page->layout = str_replace ('</head>', '<style>' . strip_tags (file_get_contents ($_GET['css'])) . '</style></head>', $page->layout); 	} } else { 	if (! empty ($_POST['layout'])) { 		} 	} 	if ($_POST['css']) { 		$page->layout = str_replace ('</head>', '<style>' . strip_tags ($_POST['css']) . '</style></head>', $page->layout); 	}	 } 

Patch:
patch: @@ -23,7 +23,7 @@
 		}
 	}
 	if ($_GET['css'] && preg_match ('/^(layouts|css)\/[a-z0-9\/ _-]+\.css$/i', $_GET['css'])) {
-		$page->layout = str_replace ('</head>', '<style>' . file_get_contents ($_GET['css']) . '</style></head>', $page->layout);
+		$page->layout = str_replace ('</head>', '<style>' . strip_tags (file_get_contents ($_GET['css'])) . '</style></head>', $page->layout);
 	}
 } else {
 	if (! empty ($_POST['layout'])) {
@@ -36,7 +36,7 @@
 		}
 	}
 	if ($_POST['css']) {
-		$page->layout = str_replace ('</head>', '<style>' . $_POST['css'] . '</style></head>', $page->layout);
+		$page->layout = str_replace ('</head>', '<style>' . strip_tags ($_POST['css']) . '</style></head>', $page->layout);
 	}	
 }
path: apps/designer/handlers/csspreview.php
Vulnerability: The Apache2 component in PHP before 5.6.38, 7.0.x before 7.0.32, 7.1.x before 7.1.22, and 7.2.x before 7.2.10 allows XSS via the body of a "Transfer-Encoding: chunked" request, because the bucket brigade is mishandled in the php_handler function in sapi/apache2handler/sapi_apache2.c.
Vulnerability ID: CVE-2018-17082
CWE: CWE-79
Severity score: 2.9
Project: https://github.com/php/php-src
Published: 2018-09-16
File: sapi/apache2handler/sapi_apache2.c
Commit message: Fix for bug #76582

The brigade seems to end up in a messed up state if something fails
in shutdown, so we clean it up.
Commit author: Stanislav Malyshev

Vulnerable version (before fix):
 zend_first_try { 	if (!parent_req) { 		php_apache_request_dtor(r TSRMLS_CC); 		ctx->request_processed = 1; 		bucket = apr_bucket_eos_create(r->connection->bucket_alloc); 		APR_BRIGADE_INSERT_TAIL(brigade, bucket); 

Fixed version (after fix):
 zend_first_try { 	if (!parent_req) { 		php_apache_request_dtor(r TSRMLS_CC); 		ctx->request_processed = 1; 		apr_brigade_cleanup(brigade); 		bucket = apr_bucket_eos_create(r->connection->bucket_alloc); 		APR_BRIGADE_INSERT_TAIL(brigade, bucket); 

Patch:
patch: @@ -678,6 +678,7 @@ zend_first_try {
 	if (!parent_req) {
 		php_apache_request_dtor(r TSRMLS_CC);
 		ctx->request_processed = 1;
+		apr_brigade_cleanup(brigade);
 		bucket = apr_bucket_eos_create(r->connection->bucket_alloc);
 		APR_BRIGADE_INSERT_TAIL(brigade, bucket);
path: sapi/apache2handler/sapi_apache2.c
Vulnerability: An issue was discovered in Open vSwitch (OvS) 2.7.x through 2.7.6. The decode_bundle function inside lib/ofp-actions.c is affected by a buffer over-read issue during BUNDLE action decoding.
Vulnerability ID: CVE-2018-17206
CWE: CWE-125
Severity score: 2.9
Project: https://github.com/openvswitch/ovs
Published: 2018-09-19
File: lib/ofp-actions.c
Commit message: ofp-actions: Avoid buffer overread in BUNDLE action decoding.

Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9052
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
Commit author: Ben Pfaff

Vulnerable version (before fix):
 decode_bundle(bool load, const struct nx_action_bundle *nab,                      load ? "bundle_load" : "bundle", slaves_size,                      bundle->n_slaves * sizeof(ovs_be16), bundle->n_slaves);         error = OFPERR_OFPBAC_BAD_LEN;     }      for (i = 0; i < bundle->n_slaves; i++) {         ofp_port_t ofp_port = u16_to_ofp(ntohs(((ovs_be16 *)(nab + 1))[i]));         ofpbuf_put(ofpacts, &ofp_port, sizeof ofp_port);         bundle = ofpacts->header;     }      ofpact_finish_BUNDLE(ofpacts, &bundle);

Fixed version (after fix):
 decode_bundle(bool load, const struct nx_action_bundle *nab,                      load ? "bundle_load" : "bundle", slaves_size,                      bundle->n_slaves * sizeof(ovs_be16), bundle->n_slaves);         error = OFPERR_OFPBAC_BAD_LEN;     } else {         for (i = 0; i < bundle->n_slaves; i++) {             ofp_port_t ofp_port                 = u16_to_ofp(ntohs(((ovs_be16 *)(nab + 1))[i]));             ofpbuf_put(ofpacts, &ofp_port, sizeof ofp_port);             bundle = ofpacts->header;         }     }      ofpact_finish_BUNDLE(ofpacts, &bundle);

Patch:
patch: @@ -1357,12 +1357,13 @@ decode_bundle(bool load, const struct nx_action_bundle *nab,
                      load ? "bundle_load" : "bundle", slaves_size,
                      bundle->n_slaves * sizeof(ovs_be16), bundle->n_slaves);
         error = OFPERR_OFPBAC_BAD_LEN;
-    }
-
-    for (i = 0; i < bundle->n_slaves; i++) {
-        ofp_port_t ofp_port = u16_to_ofp(ntohs(((ovs_be16 *)(nab + 1))[i]));
-        ofpbuf_put(ofpacts, &ofp_port, sizeof ofp_port);
-        bundle = ofpacts->header;
+    } else {
+        for (i = 0; i < bundle->n_slaves; i++) {
+            ofp_port_t ofp_port
+                = u16_to_ofp(ntohs(((ovs_be16 *)(nab + 1))[i]));
+            ofpbuf_put(ofpacts, &ofp_port, sizeof ofp_port);
+            bundle = ofpacts->header;
+        }
     }
 
     ofpact_finish_BUNDLE(ofpacts, &bundle);
path: lib/ofp-actions.c
Vulnerability: An issue was discovered in WAVM before 2018-09-16. The run function in Programs/wavm/wavm.cpp does not check whether there is Emscripten memory to store the command-line arguments passed by the input WebAssembly file's main function, which allows attackers to cause a denial of service (application crash by NULL pointer dereference) or possibly have unspecified other impact by crafting certain WebAssembly files.
Vulnerability ID: CVE-2018-17293
CWE: CWE-476
Severity score: 6.4
Project: https://github.com/WAVM/WAVM
Published: 2018-09-21
File: Programs/wavm/wavm.cpp
Commit message: Fix dereferencing null pointer when running wavm with WebAssembly main function that takes command-line arguments but no Emscripten memory to write them to
Commit author: Andrew Scheidecker

Vulnerable version (before fix):
 static int run(const CommandLineOptions& options) 	{ 		if(functionType.params().size() == 2) 		{ 			MemoryInstance* defaultMemory = Runtime::getDefaultMemory(moduleInstance); 			if(!defaultMemory) 			{ 				Log::printf( 					Log::error, 					"Module does not declare a default memory object to put arguments in.\n"); 				return EXIT_FAILURE; 			}  			std::vector<const char*> argStrings; 			argStrings.push_back(options.filename); 			char** args = options.args; 			while(*args) { argStrings.push_back(*args++); };  			Emscripten::injectCommandArgs(emscriptenInstance, argStrings, invokeArgs); 		} 		else if(functionType.params().size() > 0) 		{

Fixed version (after fix):
 static int run(const CommandLineOptions& options) 	{ 		if(functionType.params().size() == 2) 		{ 			if(!emscriptenInstance) 			{ 				Log::printf( 					Log::error, 					"Module does not declare a default memory object to put arguments in.\n"); 				return EXIT_FAILURE; 			} 			else 			{ 				std::vector<const char*> argStrings; 				argStrings.push_back(options.filename); 				char** args = options.args; 				while(*args) { argStrings.push_back(*args++); };  				wavmAssert(emscriptenInstance); 				Emscripten::injectCommandArgs(emscriptenInstance, argStrings, invokeArgs); 			} 		} 		else if(functionType.params().size() > 0) 		{

Patch:
patch: @@ -250,21 +250,23 @@ static int run(const CommandLineOptions& options)
 	{
 		if(functionType.params().size() == 2)
 		{
-			MemoryInstance* defaultMemory = Runtime::getDefaultMemory(moduleInstance);
-			if(!defaultMemory)
+			if(!emscriptenInstance)
 			{
 				Log::printf(
 					Log::error,
 					"Module does not declare a default memory object to put arguments in.\n");
 				return EXIT_FAILURE;
 			}
+			else
+			{
+				std::vector<const char*> argStrings;
+				argStrings.push_back(options.filename);
+				char** args = options.args;
+				while(*args) { argStrings.push_back(*args++); };
 
-			std::vector<const char*> argStrings;
-			argStrings.push_back(options.filename);
-			char** args = options.args;
-			while(*args) { argStrings.push_back(*args++); };
-
-			Emscripten::injectCommandArgs(emscriptenInstance, argStrings, invokeArgs);
+				wavmAssert(emscriptenInstance);
+				Emscripten::injectCommandArgs(emscriptenInstance, argStrings, invokeArgs);
+			}
 		}
 		else if(functionType.params().size() > 0)
 		{
path: Programs/wavm/wavm.cpp
Vulnerability: The matchCurrentInput function inside lou_translateString.c of Liblouis prior to 3.7 does not check the input string's length, allowing attackers to cause a denial of service (application crash via out-of-bounds read) by crafting an input file with certain translation dictionaries.
Vulnerability ID: CVE-2018-17294
CWE: CWE-125
Severity score: 2.9
Project: https://github.com/liblouis/liblouis
Published: 2018-09-21
File: liblouis/lou_translateString.c
Commit message: Fix a buffer overflow

Fixes #635

Thanks to HongxuChen for reporting it
Commit author: Christian Egli

Vulnerable version (before fix):
 matchCurrentInput( 		const InString *input, int pos, const widechar *passInstructions, int passIC) { 	int k; 	int kk = pos; 	for (k = passIC + 2; k < passIC + 2 + passInstructions[passIC + 1]; k++) 		if (input->chars[kk] == ENDSEGMENT || passInstructions[k] != input->chars[kk++]) 			return 0; 	return 1;

Fixed version (after fix):
 matchCurrentInput( 		const InString *input, int pos, const widechar *passInstructions, int passIC) { 	int k; 	int kk = pos; 	for (k = passIC + 2; 			((k < passIC + 2 + passInstructions[passIC + 1]) && (kk < input->length)); 			k++) 		if (input->chars[kk] == ENDSEGMENT || passInstructions[k] != input->chars[kk++]) 			return 0; 	return 1;

Patch:
patch: @@ -354,7 +354,9 @@ matchCurrentInput(
 		const InString *input, int pos, const widechar *passInstructions, int passIC) {
 	int k;
 	int kk = pos;
-	for (k = passIC + 2; k < passIC + 2 + passInstructions[passIC + 1]; k++)
+	for (k = passIC + 2;
+			((k < passIC + 2 + passInstructions[passIC + 1]) && (kk < input->length));
+			k++)
 		if (input->chars[kk] == ENDSEGMENT || passInstructions[k] != input->chars[kk++])
 			return 0;
 	return 1;
path: liblouis/lou_translateString.c
Vulnerability: www/guis/admin/application/controllers/UserController.php in the administration login interface in MailCleaner CE 2018.08 and 2018.09 allows XSS via the admin/login/user/message/ PATH_INFO.
Vulnerability ID: CVE-2018-18635
CWE: CWE-79
Severity score: 2.9
Project: https://github.com/MailCleaner/MailCleaner
Published: 2018-10-24
File: www/guis/admin/application/controllers/UserController.php
Commit message: Bug fix - Issue #53

Bug fix of a XSS issue on MailCleaner login (administration) interface. See issue #53 
The "message" parameter was only used for the logoutAction(). However, the parameter was not checked and not escaped.
Commit author: Mentor Reka

Vulnerable version (before fix):
 public function loginAction()          $request = $this->getRequest();         $form    = new Default_Form_Login();         if ($this->getRequest()->getParam('message')) {         	$form->addErrorMessage($this->getRequest()->getParam('message'));         }                  if ($this->getRequest()->isPost() && $form->isValid($request->getPost())) {

Fixed version (after fix):
 public function loginAction()          $request = $this->getRequest();         $form    = new Default_Form_Login();                  // Display only loggedOut message         if ($this->getRequest()->getParam('message') == "loggedOut") {         	$form->addErrorMessage(htmlspecialchars($this->getRequest()->getParam('message')));         }                  if ($this->getRequest()->isPost() && $form->isValid($request->getPost())) {

Patch:
patch: @@ -33,8 +33,10 @@ public function loginAction()
 
         $request = $this->getRequest();
         $form    = new Default_Form_Login();
-        if ($this->getRequest()->getParam('message')) {
-        	$form->addErrorMessage($this->getRequest()->getParam('message'));
+        
+        // Display only loggedOut message
+        if ($this->getRequest()->getParam('message') == "loggedOut") {
+        	$form->addErrorMessage(htmlspecialchars($this->getRequest()->getParam('message')));
         }
         
         if ($this->getRequest()->isPost() && $form->isValid($request->getPost())) {
path: www/guis/admin/application/controllers/UserController.php
Vulnerability: An issue was discovered in the Linux kernel through 4.19. An information leak in cdrom_ioctl_select_disc in drivers/cdrom/cdrom.c could be used by local attackers to read kernel memory because a cast from unsigned long to int interferes with bounds checking. This is similar to CVE-2018-10940 and CVE-2018-16658.
Vulnerability ID: CVE-2018-18710
CWE: CWE-200
Severity score: 2.9
Project: https://github.com/torvalds/linux
Published: 2018-10-29
File: drivers/cdrom/cdrom.c
Commit message: cdrom: fix improper type cast, which can leat to information leak.

There is another cast from unsigned long to int which causes
a bounds check to fail with specially crafted input. The value is
then used as an index in the slot array in cdrom_slot_status().

This issue is similar to CVE-2018-16658 and CVE-2018-10940.

Signed-off-by: Young_X <YangX92@hotmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Commit author: Young_X

Vulnerable version (before fix):
 static int cdrom_ioctl_select_disc(struct cdrom_device_info *cdi, 		return -ENOSYS;  	if (arg != CDSL_CURRENT && arg != CDSL_NONE) { 		if ((int)arg >= cdi->capacity) 			return -EINVAL; 	} 

Fixed version (after fix):
 static int cdrom_ioctl_select_disc(struct cdrom_device_info *cdi, 		return -ENOSYS;  	if (arg != CDSL_CURRENT && arg != CDSL_NONE) { 		if (arg >= cdi->capacity) 			return -EINVAL; 	} 

Patch:
patch: @@ -2445,7 +2445,7 @@ static int cdrom_ioctl_select_disc(struct cdrom_device_info *cdi,
 		return -ENOSYS;
 
 	if (arg != CDSL_CURRENT && arg != CDSL_NONE) {
-		if ((int)arg >= cdi->capacity)
+		if (arg >= cdi->capacity)
 			return -EINVAL;
 	}
path: drivers/cdrom/cdrom.c
Vulnerability: keepalived before 2.0.7 has a heap-based buffer overflow when parsing HTTP status codes resulting in DoS or possibly unspecified other impact, because extract_status_code in lib/html.c has no validation of the status code and instead writes an unlimited amount of data to the heap.
Vulnerability ID: CVE-2018-19115
CWE: CWE-787
Severity score: 6.4
Project: https://github.com/acassen/keepalived
Published: 2018-11-08
File: lib/html.c
Commit message: Fix buffer overflow in extract_status_code()

Issue #960 identified that the buffer allocated for copying the
HTTP status code could overflow if the http response was corrupted.

This commit changes the way the status code is read, avoids copying
data, and also ensures that the status code is three digits long,
is non-negative and occurs on the first line of the response.

Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
Commit author: Quentin Armitage

Vulnerable version (before fix):
 size_t extract_content_length(char *buffer, size_t size)  */ int extract_status_code(char *buffer, size_t size) { 	char *buf_code; 	char *begin; 	char *end = buffer + size; 	size_t inc = 0; 	int code;  	/* Allocate the room */ 	buf_code = (char *)MALLOC(10);  	/* Status-Code extraction */ 	while (buffer < end && *buffer++ != ' ') ; 	begin = buffer; 	while (buffer < end && *buffer++ != ' ') 		inc++; 	strncat(buf_code, begin, inc); 	code = atoi(buf_code); 	FREE(buf_code); 	return code; } 

Fixed version (after fix):
 size_t extract_content_length(char *buffer, size_t size)  */ int extract_status_code(char *buffer, size_t size) { 	char *end = buffer + size; 	unsigned long code;  	/* Status-Code extraction */ 	while (buffer < end && *buffer != ' ' && *buffer != '\r') 		buffer++; 	buffer++; 	if (buffer + 3 >= end || *buffer == ' ' || buffer[3] != ' ') 		return 0; 	code = strtoul(buffer, &end, 10); 	if (buffer + 3 != end) 		return 0; 	return code; } 

Patch:
patch: @@ -58,23 +58,18 @@ size_t extract_content_length(char *buffer, size_t size)
  */
 int extract_status_code(char *buffer, size_t size)
 {
-	char *buf_code;
-	char *begin;
 	char *end = buffer + size;
-	size_t inc = 0;
-	int code;
-
-	/* Allocate the room */
-	buf_code = (char *)MALLOC(10);
+	unsigned long code;
 
 	/* Status-Code extraction */
-	while (buffer < end && *buffer++ != ' ') ;
-	begin = buffer;
-	while (buffer < end && *buffer++ != ' ')
-		inc++;
-	strncat(buf_code, begin, inc);
-	code = atoi(buf_code);
-	FREE(buf_code);
+	while (buffer < end && *buffer != ' ' && *buffer != '\r')
+		buffer++;
+	buffer++;
+	if (buffer + 3 >= end || *buffer == ' ' || buffer[3] != ' ')
+		return 0;
+	code = strtoul(buffer, &end, 10);
+	if (buffer + 3 != end)
+		return 0;
 	return code;
 }
path: lib/html.c
Vulnerability: An issue was discovered in uriparser before 0.9.0. UriCommon.c allows attempted operations on NULL input via a uriResetUri* function.
Vulnerability ID: CVE-2018-19200
CWE: CWE-476
Severity score: 2.9
Project: https://github.com/uriparser/uriparser
Published: 2018-11-12
File: src/UriCommon.c
Commit message: ResetUri: Protect against NULL
Commit author: Sebastian Pipping

Vulnerable version (before fix):
   void URI_FUNC(ResetUri)(URI_TYPE(Uri) * uri) { 	memset(uri, 0, sizeof(URI_TYPE(Uri))); } 

Fixed version (after fix):
   void URI_FUNC(ResetUri)(URI_TYPE(Uri) * uri) { 	if (uri == NULL) { 		return; 	} 	memset(uri, 0, sizeof(URI_TYPE(Uri))); } 

Patch:
patch: @@ -75,6 +75,9 @@
 
 
 void URI_FUNC(ResetUri)(URI_TYPE(Uri) * uri) {
+	if (uri == NULL) {
+		return;
+	}
 	memset(uri, 0, sizeof(URI_TYPE(Uri)));
 }
path: src/UriCommon.c