[openssh-commits] [openssh] 02/03: upstream: check strdup() return to avoid NULL deref on failure.

git+noreply at mindrot.org git+noreply at mindrot.org
Mon Jun 29 19:16:41 AEST 2026


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 5d8e42933ab3f1a1c17608c32d680300f5524a99
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Mon Jun 29 08:59:31 2026 +0000

    upstream: check strdup() return to avoid NULL deref on failure.
    
    bz3948 from RuiHe-MO
    
    OpenBSD-Commit-ID: 2b1fbfb2e1f3359150feadfdf05acaa1c7d211e8
---
 servconf.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/servconf.c b/servconf.c
index 09fef2e7a..ce388f1dd 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: servconf.c,v 1.449 2026/06/14 03:59:34 djm Exp $ */
+/* $OpenBSD: servconf.c,v 1.450 2026/06/29 08:59:31 djm Exp $ */
 /*
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
  *                    All rights reserved
@@ -2166,7 +2166,7 @@ process_server_config_line_depth(ServerOptions *options, char *line,
 				debug2("%s line %d: no match for %s",
 				    filename, linenum, arg);
 				item = xcalloc(1, sizeof(*item));
-				item->selector = strdup(arg);
+				item->selector = xstrdup(arg);
 				TAILQ_INSERT_TAIL(includes,
 				    item, entry);
 			}
@@ -2176,8 +2176,8 @@ process_server_config_line_depth(ServerOptions *options, char *line,
 				debug2("%s line %d: including %s",
 				    filename, linenum, gbuf.gl_pathv[n]);
 				item = xcalloc(1, sizeof(*item));
-				item->selector = strdup(arg);
-				item->filename = strdup(gbuf.gl_pathv[n]);
+				item->selector = xstrdup(arg);
+				item->filename = xstrdup(gbuf.gl_pathv[n]);
 				if ((item->contents = sshbuf_new()) == NULL)
 					fatal_f("sshbuf_new failed");
 				load_server_config(item->filename,

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list