67a767d
From c9a2a6fea0668579f5fb8d77cb219f51d104581f Mon Sep 17 00:00:00 2001
67a767d
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
67a767d
Date: Wed, 6 Jan 2016 17:58:22 +0100
67a767d
Subject: [PATCH] Validate upper bound of RPC port
67a767d
MIME-Version: 1.0
67a767d
Content-Type: text/plain; charset=UTF-8
67a767d
Content-Transfer-Encoding: 8bit
67a767d
67a767d
Signed-off-by: Petr Písař <ppisar@redhat.com>
67a767d
---
67a767d
 rquota_svc.c | 2 +-
67a767d
 1 file changed, 1 insertion(+), 1 deletion(-)
67a767d
67a767d
diff --git a/rquota_svc.c b/rquota_svc.c
67a767d
index 338b70f..93472e0 100644
67a767d
--- a/rquota_svc.c
67a767d
+++ b/rquota_svc.c
67a767d
@@ -142,7 +142,7 @@ static void parse_options(int argc, char **argv)
67a767d
 				break;
67a767d
 			case 'p': 
67a767d
 				port = strtol(optarg, &endptr, 0);
67a767d
-				if (*endptr || port <= 0) {
67a767d
+				if (*endptr || port <= 0 || port > 0xffff) {
67a767d
 					errstr(_("Illegal port number: %s\n"), optarg);
67a767d
 					show_help();
67a767d
 					exit(1);
67a767d
-- 
67a767d
2.5.0
67a767d