poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[COMMITTED] ios: fix uninitialized variable access in ios-dev-mmap


From: Jose E. Marchesi
Subject: [COMMITTED] ios: fix uninitialized variable access in ios-dev-mmap
Date: Sat, 30 Mar 2024 20:37:37 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

2024-03-30  Jose E. Marchesi  <jemarch@gnu.org>

        * libpoke/ios-dev-mmap.c (ios_dev_mmap_open): Avoid using variable
        fd uninitialized.
---
 ChangeLog              | 5 +++++
 libpoke/ios-dev-mmap.c | 3 +--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3ad7bdc1..81a81ffc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-03-30  Jose E. Marchesi  <jemarch@gnu.org>
+
+       * libpoke/ios-dev-mmap.c (ios_dev_mmap_open): Avoid using variable
+       fd uninitialized.
+
 2024-03-30  Jose E. Marchesi  <jemarch@gnu.org>
 
        * NEWS: Update for 4.0.
diff --git a/libpoke/ios-dev-mmap.c b/libpoke/ios-dev-mmap.c
index 0763592c..ab0ffbbd 100644
--- a/libpoke/ios-dev-mmap.c
+++ b/libpoke/ios-dev-mmap.c
@@ -140,7 +140,7 @@ ios_dev_mmap_open (const char *handler, uint64_t flags, int 
*error,
   int internal_error = IOD_ERROR;
   uint8_t mode_flags = flags & IOS_FLAGS_MODE;
   int open_flags = 0;
-  int fd;
+  int fd = -1;
   const char *p;
   char *end;
   struct stat st;
@@ -150,7 +150,6 @@ ios_dev_mmap_open (const char *handler, uint64_t flags, int 
*error,
   if (!dev_map)
     goto err;
 
-  fd = -1;
   memset (dev_map, 0, sizeof (struct ios_dev_mmap));
 
   /* Format of handler:
-- 
2.30.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]