From 137e0ed524df0f9059dcc8747d240af1432d7eb8 Mon Sep 17 00:00:00 2001 From: "djm@openbsd.org" Date: Fri, 30 Oct 2026 02:15:00 +0000 Subject: [PATCH] upstream: avoid debug message printing past the end of an unterminated string on a GSSAPIAuthentication failure path Anthropic ANT-2026-IFWU9Y2V OpenBSD-Commit-ID: 51f457a6688518fecc3ab518df8bc5b5a4b9e175 --- gss-genr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gss-genr.c b/gss-genr.c index 7088d93b4..6d98c32ef 100644 --- a/gss-genr.c +++ b/gss-genr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gss-genr.c,v 1.31 2026/02/08 19:54:31 dtucker Exp $ */ +/* $OpenBSD: gss-genr.c,v 1.32 2026/10/30 02:15:00 djm Exp $ */ /* * Copyright (c) 2001-2007 Simon Wilkinson. All rights reserved. @@ -147,7 +147,8 @@ ssh_gssapi_last_error(Gssctxt *ctxt, OM_uint32 *major_status, if ((r = sshbuf_put_u8(b, '\n')) != 0) fatal_fr(r, "assemble newline"); - ret = xstrdup((const char *)sshbuf_ptr(b)); + if ((ret = sshbuf_dup_string(b)) == NULL) + fatal_f("sshbuf_dup_string failed"); sshbuf_free(b); return (ret); }