@@ -73,22 +73,6 @@ diff -up openssh-8.5p1/loginrec.c.coverity openssh-8.5p1/loginrec.c
7373 strncpy(ut->ut_host, li->hostname,
7474 MIN_SIZEOF(ut->ut_host, li->hostname));
7575 # endif
76- @@ -1690,6 +1692,7 @@ record_failed_login(struct ssh *ssh, con
77-
78- memset(&ut, 0, sizeof(ut));
79- /* strncpy because we don't necessarily want nul termination */
80- + /* coverity[buffer_size_warning : FALSE] */
81- strncpy(ut.ut_user, username, sizeof(ut.ut_user));
82- strlcpy(ut.ut_line, "ssh:notty", sizeof(ut.ut_line));
83-
84- @@ -1699,6 +1702,7 @@ record_failed_login(struct ssh *ssh, con
85- ut.ut_pid = getpid();
86-
87- /* strncpy because we don't necessarily want nul termination */
88- + /* coverity[buffer_size_warning : FALSE] */
89- strncpy(ut.ut_host, hostname, sizeof(ut.ut_host));
90-
91- if (ssh_packet_connection_is_on_socket(ssh) &&
9276diff -up openssh-8.5p1/misc.c.coverity openssh-8.5p1/misc.c
9377--- openssh-8.5p1/misc.c.coverity 2021-03-24 12:03:33.745967902 +0100
9478+++ openssh-8.5p1/misc.c 2021-03-24 13:31:47.037079617 +0100
@@ -175,6 +159,46 @@ diff -up openssh-8.7p1/openbsd-compat/bsd-pselect.c.coverity openssh-8.7p1/openb
175159diff -up openssh-8.5p1/readconf.c.coverity openssh-8.5p1/readconf.c
176160--- openssh-8.5p1/readconf.c.coverity 2021-03-24 12:03:33.778968131 +0100
177161+++ openssh-8.5p1/readconf.c 2021-03-24 12:03:33.785968180 +0100
162+ @@ -749,12 +749,12 @@ match_cfg_line(Options *options, const c
163+ debug2("checking match for '%s' host %s originally %s",
164+ full_line, host, original_host);
165+ while ((attrib = argv_next(acp, avp)) != NULL) {
166+ - attrib = oattrib = xstrdup(attrib);
167+ /* Terminate on comment */
168+ if (*attrib == '#') {
169+ argv_consume(acp);
170+ break;
171+ }
172+ + attrib = oattrib = xstrdup(attrib);
173+ arg = criteria = NULL;
174+ this_result = 1;
175+ if ((negate = (attrib[0] == '!')))
176+ @@ -793,7 +793,7 @@ match_cfg_line(Options *options, const c
177+ debug3("%.200s line %d: %smatched '%s'",
178+ filename, linenum,
179+ this_result ? "" : "not ", oattrib);
180+ - continue;
181+ + goto next;
182+ }
183+
184+ /* Keep this list in sync with below */
185+ @@ -863,7 +863,7 @@ match_cfg_line(Options *options, const c
186+ debug3("%.200s line %d: skipped exec "
187+ "\"%.100s\"", filename, linenum, cmd);
188+ free(cmd);
189+ - continue;
190+ + goto next;
191+ }
192+ r = execute_in_shell(cmd);
193+ if (r == -1) {
194+ @@ -887,6 +887,7 @@ match_cfg_line(Options *options, const c
195+ criteria == NULL ? "" : " \"",
196+ criteria == NULL ? "" : criteria,
197+ criteria == NULL ? "" : "\"");
198+ + next:
199+ free(criteria);
200+ free(oattrib);
201+ oattrib = attrib = NULL;
178202@@ -1847,6 +1847,7 @@ parse_pubkey_algos:
179203 } else if (r != 0) {
180204 error("%.200s line %d: glob failed for %s.",
@@ -186,6 +210,108 @@ diff -up openssh-8.5p1/readconf.c.coverity openssh-8.5p1/readconf.c
186210diff -up openssh-7.4p1/servconf.c.coverity openssh-7.4p1/servconf.c
187211--- openssh-7.4p1/servconf.c.coverity 2016-12-23 16:40:26.896788690 +0100
188212+++ openssh-7.4p1/servconf.c 2016-12-23 16:40:26.901788691 +0100
213+ @@ -1120,12 +1120,12 @@ match_cfg_line(const char *full_line, in
214+ }
215+
216+ while ((oattrib = argv_next(acp, avp)) != NULL) {
217+ - attrib = xstrdup(oattrib);
218+ /* Terminate on comment */
219+ - if (*attrib == '#') {
220+ + if (*oattrib == '#') {
221+ argv_consume(acp); /* mark all arguments consumed */
222+ break;
223+ }
224+ + attrib = xstrdup(oattrib);
225+ arg = NULL;
226+ attributes++;
227+ /* Criterion "all" has no argument and must appear alone */
228+ @@ -1147,13 +1147,13 @@ match_cfg_line(const char *full_line, in
229+ if (strcasecmp(attrib, "invalid-user") == 0) {
230+ if (ci == NULL) {
231+ result = 0;
232+ - continue;
233+ + goto next;
234+ }
235+ if (ci->user_invalid == 0)
236+ result = 0;
237+ else
238+ debug("matched invalid-user at line %d", line);
239+ - continue;
240+ + goto next;
241+ }
242+
243+ /* Keep this list in sync with below */
244+ @@ -1179,7 +1179,7 @@ match_cfg_line(const char *full_line, in
245+ if (strcasecmp(attrib, "user") == 0) {
246+ if (ci == NULL || (ci->test && ci->user == NULL)) {
247+ result = 0;
248+ - continue;
249+ + goto next;
250+ }
251+ if (ci->user == NULL)
252+ match_test_missing_fatal("User", "user");
253+ @@ -1191,7 +1191,7 @@ match_cfg_line(const char *full_line, in
254+ } else if (strcasecmp(attrib, "group") == 0) {
255+ if (ci == NULL || (ci->test && ci->user == NULL)) {
256+ result = 0;
257+ - continue;
258+ + goto next;
259+ }
260+ if (ci->user == NULL)
261+ match_test_missing_fatal("Group", "user");
262+ @@ -1205,7 +1205,7 @@ match_cfg_line(const char *full_line, in
263+ } else if (strcasecmp(attrib, "host") == 0) {
264+ if (ci == NULL || (ci->test && ci->host == NULL)) {
265+ result = 0;
266+ - continue;
267+ + goto next;
268+ }
269+ if (ci->host == NULL)
270+ match_test_missing_fatal("Host", "host");
271+ @@ -1220,7 +1220,7 @@ match_cfg_line(const char *full_line, in
272+ fatal("Invalid Match address argument "
273+ "'%s' at line %d", arg, line);
274+ result = 0;
275+ - continue;
276+ + goto next;
277+ }
278+ if (ci->address == NULL)
279+ match_test_missing_fatal("Address", "addr");
280+ @@ -1244,7 +1244,7 @@ match_cfg_line(const char *full_line, in
281+ "argument '%s' at line %d", arg,
282+ line);
283+ result = 0;
284+ - continue;
285+ + goto next;
286+ }
287+ if (ci->laddress == NULL)
288+ match_test_missing_fatal("LocalAddress",
289+ @@ -1272,7 +1272,7 @@ match_cfg_line(const char *full_line, in
290+ }
291+ if (ci == NULL || (ci->test && ci->lport == -1)) {
292+ result = 0;
293+ - continue;
294+ + goto next;
295+ }
296+ if (ci->lport == 0)
297+ match_test_missing_fatal("LocalPort", "lport");
298+ @@ -1286,7 +1286,7 @@ match_cfg_line(const char *full_line, in
299+ } else if (strcasecmp(attrib, "rdomain") == 0) {
300+ if (ci == NULL || (ci->test && ci->rdomain == NULL)) {
301+ result = 0;
302+ - continue;
303+ + goto next;
304+ }
305+ if (ci->rdomain == NULL)
306+ match_test_missing_fatal("RDomain", "rdomain");
307+ @@ -1300,6 +1300,7 @@ match_cfg_line(const char *full_line, in
308+ result = -1;
309+ goto out;
310+ }
311+ + next:
312+ free(attrib);
313+ attrib = NULL;
314+ }
189315@@ -1638,8 +1638,9 @@ process_server_config_line(ServerOptions
190316 if (*activep && *charptr == NULL) {
191317 *charptr = tilde_expand_filename(arg, getuid());
@@ -262,3 +388,22 @@ diff -up openssh-8.5p1/ssh-keygen.c.coverity openssh-8.5p1/ssh-keygen.c
262388 } else {
263389 if (strncasecmp(cp, "key:", 4) == 0) {
264390 cp += 4;
391+ diff --color -ruNp a/sshd.c b/sshd.c
392+ --- a/sshd.c 2026-04-01 14:29:14.186736233 +0200
393+ +++ b/sshd.c 2026-04-01 14:36:59.136881819 +0200
394+ @@ -1079,6 +1079,7 @@ server_accept_loop(int *sock_in, int *so
395+ send_rexec_state(config_s[0], cfg);
396+ close(config_s[0]);
397+ free(pfd);
398+ + free(startup_pollfd);
399+ return;
400+ }
401+
402+ @@ -1111,6 +1112,7 @@ server_accept_loop(int *sock_in, int *so
403+ log_stderr);
404+ close(config_s[0]);
405+ free(pfd);
406+ + free(startup_pollfd);
407+ return;
408+ }
409+
0 commit comments