From e3b8965f5c23f4c5342d47edbce78d8b7d1ef76c Mon Sep 17 00:00:00 2001 From: dtucker Date: Sun, 12 Mar 2023 09:41:18 +0000 Subject: [PATCH] calloc can return NULL but xcalloc cannot. From Coverity CID 291881, ok djm@ --- usr.bin/ssh/sftp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/ssh/sftp.c b/usr.bin/ssh/sftp.c index da772cadcd5..a9d74dc25d5 100644 --- a/usr.bin/ssh/sftp.c +++ b/usr.bin/ssh/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 * @@ -980,7 +980,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; -- 2.20.1