File: 0010-ttyplay-don-t-use-uninitialised-memory-on-partial-he.patch

package info (click to toggle)
ttyrec 1.1.7.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 856 kB
  • sloc: ansic: 2,490; sh: 246; makefile: 49; perl: 48
file content (21 lines) | stat: -rw-r--r-- 549 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
From: =?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz>
Date: Sat, 25 Jan 2025 17:55:26 +0100
Subject: ttyplay: don't use uninitialised memory on partial header read

---
 io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/io.c b/io.c
index 63321a5..2613d66 100644
--- a/io.c
+++ b/io.c
@@ -57,7 +57,7 @@ int read_header(FILE *fp, Header *h)
 {
     uint32_t buf[3];
 
-    if (fread_wrapper(buf, sizeof(uint32_t), 3, fp) == 0)
+    if (fread_wrapper(buf, sizeof(uint32_t), 3, fp) != 3)
     {
         return 0;
     }