From: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
To: kumagai-atsushi@mxc.nes.nec.co.jp
Cc: kexec@lists.infradead.org
Subject: [PATCH 1/2] sadump: correct buffer size for GUID EFI text representation
Date: Fri, 13 Sep 2013 19:53:27 +0900 [thread overview]
Message-ID: <20130913105327.2332.70627.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20130913105216.2332.8060.stgit@localhost6.localdomain6>
While GUID EFI text representaion needs 36 bytes, all the buffers for
GUID EFI passed to guid_to_str() are of 33 bytes, due to which last
three characters in GUID are not displayed now.
This patch increases buffer size from 33 bytes to 36 bytes and make
GUID fully visible.
Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
---
sadump_info.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/sadump_info.c b/sadump_info.c
index be6cf55..e563180 100644
--- a/sadump_info.c
+++ b/sadump_info.c
@@ -23,6 +23,8 @@
#include "print_info.h"
#include "sadump_mod.h"
+#define SADUMP_EFI_GUID_TEXT_REPR_LEN 36
+
#ifdef __x86__
#define KEXEC_NOTE_HEAD_BYTES roundup(sizeof(Elf32_Nhdr), 4)
@@ -427,7 +429,7 @@ read_sadump_header(char *filename)
unsigned long bitmap_len, dumpable_bitmap_len;
enum sadump_format_type flag_sadump;
uint32_t smram_cpu_state_size = 0;
- char guid[33];
+ char guid[SADUMP_EFI_GUID_TEXT_REPR_LEN+1];
if ((si->sph_memory = malloc(SADUMP_DEFAULT_BLOCK_SIZE)) == NULL) {
ERRMSG("Can't allocate memory for partition header buffer: "
@@ -664,7 +666,7 @@ read_sadump_header_diskset(int diskid, struct sadump_diskset_info *sdi)
{
struct sadump_part_header *sph = NULL;
unsigned long offset = 0;
- char guid[33];
+ char guid[SADUMP_EFI_GUID_TEXT_REPR_LEN+1];
if ((sph = malloc(si->sh_memory->block_size)) == NULL) {
ERRMSG("Can't allocate memory for partition header buffer. "
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2013-09-13 10:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-13 10:53 [PATCH 0/2] makedumpfile, sadump: fix two GUID print bugs HATAYAMA Daisuke
2013-09-13 10:53 ` HATAYAMA Daisuke [this message]
2013-09-13 10:53 ` [PATCH 2/2] sadump: convert the first three fields of EFI GUID from little-endian into big-endian HATAYAMA Daisuke
2013-09-17 6:20 ` [PATCH 0/2] makedumpfile, sadump: fix two GUID print bugs Atsushi Kumagai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130913105327.2332.70627.stgit@localhost6.localdomain6 \
--to=d.hatayama@jp.fujitsu.com \
--cc=kexec@lists.infradead.org \
--cc=kumagai-atsushi@mxc.nes.nec.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox