commit a6bae7b: [Minor] Properly set protocol value for urls

Vsevolod Stakhov vsevolod at highsecure.ru
Sat Feb 16 14:28:06 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-02-16 14:22:19 +0000
URL: https://github.com/rspamd/rspamd/commit/a6bae7b5bd0b914cc73aef68aa002210c35b1cd9

[Minor] Properly set protocol value for urls

---
 src/libserver/url.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/libserver/url.c b/src/libserver/url.c
index ae2f84300..4e1b9f3d2 100644
--- a/src/libserver/url.c
+++ b/src/libserver/url.c
@@ -1867,9 +1867,9 @@ rspamd_url_parse (struct rspamd_url *uri,
 
 	for (i = 0; i < G_N_ELEMENTS (rspamd_url_protocols); i++) {
 		if (uri->protocollen == rspamd_url_protocols[i].len) {
-			if (memcmp (uri->string, rspamd_url_protocols[i].name, uri->protocollen) ==
-				0) {
-				uri->protocol = i;
+			if (memcmp (uri->string,
+					rspamd_url_protocols[i].name, uri->protocollen) == 0) {
+				uri->protocol = rspamd_url_protocols[i].proto;
 				break;
 			}
 		}


More information about the Commits mailing list