diff options
| author | Marc-André Lureau | 2017-12-12 15:53:59 +0100 |
|---|---|---|
| committer | Marc-André Lureau | 2018-01-02 14:49:54 +0100 |
| commit | c983ca845782bf91171b5ec4e59d122a21229745 (patch) | |
| tree | f9507b25d23631e007ab1ae988bb28978e6612f6 | |
| parent | Merge remote-tracking branch 'remotes/vivier/tags/m68k-for-2.12-pull-request'... (diff) | |
| download | qemu-c983ca845782bf91171b5ec4e59d122a21229745.tar.gz qemu-c983ca845782bf91171b5ec4e59d122a21229745.tar.xz qemu-c983ca845782bf91171b5ec4e59d122a21229745.zip | |
dump: fix note_name_equal()
Use the function argument "name" instead of hardcoded
"VMCOREINFO". All callers use "VMCOREINFO" as argument, so this isn't
an exposed bug, thankfully.
Simplify a little bit the code while touching this.
Suggested-by: Andrew Jones <drjones@redhat.com>
Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
| -rw-r--r-- | dump.c | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -788,12 +788,7 @@ static bool note_name_equal(DumpState *s, get_note_sizes(s, note, &head_size, &name_size, NULL); head_size = ROUND_UP(head_size, 4); - if (name_size != len || - memcmp(note + head_size, "VMCOREINFO", len)) { - return false; - } - - return true; + return name_size == len && memcmp(note + head_size, name, len) == 0; } /* write common header, sub header and elf note to vmcore */ |
