File 0023-Fail-if-ftell-fails.patch of Package fonttosfnt.20912
From 49524b5db4867b5e896ed299fd66b390e68f1ffc Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue, 25 May 2021 09:50:45 +1000
Subject: [PATCH] Fail if ftell fails
Fixes a coverity warning: ftell may return -1 on error which we then pass into
fseek later. We properly fail there anyway, so this change is unlikely to have
any real effect.
---
write.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/write.c b/write.c
index e68b70c..d86ce5f 100644
--- a/write.c
+++ b/write.c
@@ -758,6 +758,10 @@ writeEBLC(FILE* out, FontPtr font)
int offset;
location = ftell(out);
+ if (location == -1) {
+ perror("Couldn't ftell");
+ return -1;
+ }
rc = fseek(out, table->location + 4, SEEK_SET);
if(rc != 0) {
perror("Couldn't seek");
--
GitLab