openssh/upstream-Always-initialize-2nd-arg-to-hpdelim2.-It-p.patch

54 lines
1.7 KiB
Diff
Raw Normal View History

2019-09-30 11:10:51 -04:00
From 7f9fc6a467c030ab36fba3a99377ed4330545a1d Mon Sep 17 00:00:00 2001
From: guoxiaoqi <guoxiaoqi2@huawei.com>
Date: Tue, 5 Mar 2019 12:01:44 +0000
Subject: [PATCH] upstream-Always-initialize-2nd-arg-to-hpdelim2.-It-p
---
servconf.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/servconf.c b/servconf.c
index 67a71ba..434f0bc 100644
--- a/servconf.c
+++ b/servconf.c
@@ -927,6 +927,7 @@ process_permitopen_list(struct ssh *ssh, ServerOpCodes opcode,
/* Otherwise treat it as a list of permitted host:port */
for (i = 0; i < num_opens; i++) {
oarg = arg = xstrdup(opens[i]);
+ ch = '\0';
host = hpdelim2(&arg, &ch);
if (host == NULL || ch == '/')
fatal("%s: missing host in %s", __func__, what);
@@ -1246,7 +1247,7 @@ process_server_config_line(ServerOptions *options, char *line,
const char *filename, int linenum, int *activep,
struct connection_info *connectinfo)
{
- char *cp, ***chararrayptr, **charptr, *arg, *arg2, *p;
+ char ch, *cp, ***chararrayptr, **charptr, *arg, *arg2, *p;
int cmdline = 0, *intptr, value, value2, n, port;
SyslogFacility *log_facility_ptr;
LogLevel *log_level_ptr;
@@ -1349,8 +1350,8 @@ process_server_config_line(ServerOptions *options, char *line,
port = 0;
p = arg;
} else {
- char ch;
arg2 = NULL;
+ ch = '\0';
p = hpdelim2(&arg, &ch);
if (p == NULL || ch == '/')
fatal("%s line %d: bad address:port usage",
@@ -2014,8 +2015,8 @@ process_server_config_line(ServerOptions *options, char *line,
*/
xasprintf(&arg2, "*:%s", arg);
} else {
- char ch;
arg2 = xstrdup(arg);
+ ch = '\0';
p = hpdelim2(&arg, &ch);
if (p == NULL || ch == '/') {
fatal("%s line %d: missing host in %s",
--
1.8.3.1