summaryrefslogtreecommitdiffstats
path: root/sftp.c
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2023-03-12 10:41:18 +0100
committerDarren Tucker <dtucker@dtucker.net>2023-03-12 12:01:57 +0100
commit8f287ba60d342b3e2f750e7332d2131e3ec7ecd0 (patch)
tree37e54cf2fcd0fa167d9f3672755cf983d05a4cd7 /sftp.c
parentupstream: Explicitly ignore return from fcntl (diff)
downloadopenssh-8f287ba60d342b3e2f750e7332d2131e3ec7ecd0.tar.xz
openssh-8f287ba60d342b3e2f750e7332d2131e3ec7ecd0.zip
upstream: calloc can return NULL but xcalloc can't.
From Coverity CID 291881, ok djm@ OpenBSD-Commit-ID: 50204b755f66b2ec7ac3cfe379d07d85ca161d2b
Diffstat (limited to 'sftp.c')
-rw-r--r--sftp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sftp.c b/sftp.c
index 4a3774421..29081db3d 100644
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp.c,v 1.228 2023/03/08 06:21:32 dtucker Exp $ */
+/* $OpenBSD: sftp.c,v 1.229 2023/03/12 09:41:18 dtucker Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -1007,7 +1007,7 @@ do_globbed_ls(struct sftp_conn *conn, const char *path,
*/
for (nentries = 0; g.gl_pathv[nentries] != NULL; nentries++)
; /* count entries */
- indices = calloc(nentries, sizeof(*indices));
+ indices = xcalloc(nentries, sizeof(*indices));
for (i = 0; i < nentries; i++)
indices[i] = i;