From facb3d65ae911418ee10ca2fd1c1ed9a9749cf3b Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sat, 24 Aug 2013 12:27:57 +0200 Subject: datatype: fix wrong endianess in numeric ports In (5075879 datatype: validate port number in inet_service_type_parse), conversion to network byte order was missing. Reported-by: Arturo Borrero Gonzalez Signed-off-by: Pablo Neira Ayuso --- src/datatype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/datatype.c b/src/datatype.c index 3eec931b..12e876cf 100644 --- a/src/datatype.c +++ b/src/datatype.c @@ -525,7 +525,7 @@ static struct error_record *inet_service_type_parse(const struct expr *sym, if (errno == ERANGE || i > UINT16_MAX) return error(&sym->location, "Service out of range"); - port = i; + port = htons(i); } else { err = getaddrinfo(NULL, sym->identifier, NULL, &ai); if (err != 0) -- cgit v1.2.3