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