tools: libxencall/foreignmemory: initialise handle->fd
PATCH 1/1 tools: libxencall/foreignmemory: initialise handle->fd
Otherwise the osdep close on the error path touches an uninitialised varialble.
CID: 1351231 (foreignmemory) and 1351230 (call)
Signed-off-by Ian Campbell <[email protected]>
--- tools/libs/call/core.c | 2 ++ tools/libs/foreignmemory/core.c | 1 + 2 files changed, 3 insertions(+)
tools/libs/call/core.c +2 -0
@@ -24,6 +24,8 @@ xencall_handle *xencall_open(xentoollog_logger *logger, unsigned open_flags)if (!xcall)return NULL ; + xcall->fd =-1 ; + xcall->flags = open_flags; xcall->buffer_cache_nr =0 ;
tools/libs/foreignmemory/core.c +1 -0
@@ -27,6 +27,7 @@ xenforeignmemory_handle *xenforeignmemory_open(xentoollog_logger *logger,if (!fmem)return NULL ; + fmem->fd =-1 ; fmem->logger = logger; fmem->logger_tofree =NULL ;
Signature · 1 line
2.1.4
Quoted 6 lines · Ian Campbell
Otherwise the osdep close on the error path touches an uninitialised varialble.
CID: 1351231 (foreignmemory) and 1351230 (call)
Signed-off-by Ian Campbell <[email protected]>
Acked-by Wei Liu <[email protected]>
Quoted 33 lines
--- tools/libs/call/core.c | 2 ++ tools/libs/foreignmemory/core.c | 1 + 2 files changed, 3 insertions(+)tools/libs/call/core.c +2
-0@@ -24,6 +24,8 @@ xencall_handle *xencall_open(xentoollog_logger *logger, unsigned open_flags)if (!xcall)return NULL ; + xcall->fd =-1 ; + xcall->flags = open_flags; xcall->buffer_cache_nr =0 ;tools/libs/foreignmemory/core.c +1
-0@@ -27,6 +27,7 @@ xenforeignmemory_handle *xenforeignmemory_open(xentoollog_logger *logger,if (!fmem)return NULL ; + fmem->fd =-1 ; fmem->logger = logger; fmem->logger_tofree =NULL ;Signature · 1 line
2.1.4
Ian Campbell
AppliedQuoted 9 lines · Wei Liu
Quoted 6 lines · Ian Campbell
Otherwise the osdep close on the error path touches an uninitialised varialble.
CID: 1351231 (foreignmemory) and 1351230 (call)
Signed-off-by Ian Campbell <[email protected]>Acked-by Wei Liu <[email protected]>
Applied, thanks.