From: jsg Date: Thu, 25 Apr 2024 14:24:54 +0000 (+0000) Subject: add fstat() call removed in 1.145 to avoid uninitialised var use X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1e39d8b8bc106310538a1e7e9ad54597d343c2cf;p=openbsd add fstat() call removed in 1.145 to avoid uninitialised var use ok tobhe@ --- diff --git a/sbin/iked/parse.y b/sbin/iked/parse.y index b9e6f4d6c1d..613eb8fb49a 100644 --- a/sbin/iked/parse.y +++ b/sbin/iked/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.145 2024/04/13 15:58:10 jrick Exp $ */ +/* $OpenBSD: parse.y,v 1.146 2024/04/25 14:24:54 jsg Exp $ */ /* * Copyright (c) 2019 Tobias Heider @@ -1952,6 +1952,8 @@ parsekeyfile(char *filename, struct iked_auth *auth) err(1, "open %s", filename); if (check_file_secrecy(fd, filename) == -1) exit(1); + if (fstat(fd, &sb) == -1) + err(1, "parsekeyfile: stat %s", filename); if ((sb.st_size > KEYSIZE_LIMIT) || (sb.st_size == 0)) errx(1, "%s: key too %s", filename, sb.st_size ? "large" : "small");