From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.1 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 37CB11FAF4 for ; Mon, 12 Dec 2022 11:40:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1670845257; bh=geQhyJN5wYWpZ5vAEa7OWMJ2xCzwLQ/YClNRm3ObSzg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dPG/fTQkOvXKEs0TBrWvjYTe/pUq9wmOZ2PkeqRB6lhEMWawn/7Y5vchdJ4JFV+uB 3HRIaFfvdzknwvao0Bdl7NUNWj8DpfitezRXcO6XLDslkgMtmGgfhoguLqW9hBx0j7 lR2oL/ZaA/YbLlO7dIBlJPeSde805qLXsBJi3OPE= From: Eric Wong To: mwrap-perl@80x24.org Subject: [PATCH 5/5] mwrap_httpd: report ftello error Date: Mon, 12 Dec 2022 11:40:56 +0000 Message-Id: <20221212114056.9615-6-e@80x24.org> In-Reply-To: <20221212114056.9615-1-e@80x24.org> References: <20221212114056.9615-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: ftello(3) may fail if out-of-memory. --- mwrap_httpd.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mwrap_httpd.h b/mwrap_httpd.h index 6d40d6c..bfa723d 100644 --- a/mwrap_httpd.h +++ b/mwrap_httpd.h @@ -429,8 +429,10 @@ static off_t write_loc_name(FILE *fp, const struct src_loc *l) free(s); } off_t end = ftello(fp); - if (end < 0) + if (end < 0) { + fprintf(stderr, "ftello: %m\n"); return end; + } return end - beg; }