projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
023e314
)
fw_cfg: prevent selector key conflict
author
Gabriel L. Somlo
<somlo@cmu.edu>
Wed, 29 Apr 2015 15:21:51 +0000
(11:21 -0400)
committer
Gerd Hoffmann
<kraxel@redhat.com>
Wed, 10 Jun 2015 06:00:37 +0000
(08:00 +0200)
Enforce a single assignment of data for each distinct selector key.
Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/nvram/fw_cfg.c
patch
|
blob
|
history
diff --git
a/hw/nvram/fw_cfg.c
b/hw/nvram/fw_cfg.c
index d2a43470e0a52c0d87911121082e0f4e737335bf..0c0e15ecf53a962ea70ace95ea529b4cb8f1b6ea 100644
(file)
--- a/
hw/nvram/fw_cfg.c
+++ b/
hw/nvram/fw_cfg.c
@@
-423,6
+423,7
@@
static void fw_cfg_add_bytes_read_callback(FWCfgState *s, uint16_t key,
key &= FW_CFG_ENTRY_MASK;
assert(key < FW_CFG_MAX_ENTRY && len < UINT32_MAX);
+ assert(s->entries[arch][key].data == NULL); /* avoid key conflict */
s->entries[arch][key].data = data;
s->entries[arch][key].len = (uint32_t)len;