Fabian Maurer : winedump: Fix potential null-pointer dereference (cppcheck ).
Module: wine Branch: master Commit: b58094f74c2d773f110443ba52b873d1d6a8c829 URL: http://source.winehq.org/git/wine.git/?a=commit;h=b58094f74c2d773f110443ba52... Author: Fabian Maurer <dark.shadow4(a)web.de> Date: Tue Oct 3 17:28:08 2017 +0200 winedump: Fix potential null-pointer dereference (cppcheck). Signed-off-by: Fabian Maurer <dark.shadow4(a)web.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winedump/pdb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/winedump/pdb.c b/tools/winedump/pdb.c index 6a6a9b4..6fd70ce 100644 --- a/tools/winedump/pdb.c +++ b/tools/winedump/pdb.c @@ -215,7 +215,8 @@ static void *read_string_table(struct pdb_reader* reader) stream_idx = get_stream_by_name(reader, "/names"); if (stream_idx == -1) return NULL; ret = reader->read_file(reader, stream_idx); - if (ret && *(const DWORD*)ret == 0xeffeeffe) return ret; + if (!ret) return NULL; + if(*(const DWORD*)ret == 0xeffeeffe) return ret; printf("wrong header %x expecting 0xeffeeffe\n", *(const DWORD*)ret); free( ret ); return NULL;
participants (1)
-
Alexandre Julliard