diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-12-05 16:08:35 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-12-05 16:08:35 +0100 |
commit | 1e7773d2bb5a0be8b0bc0562444562aaf8a3f801 (patch) | |
tree | 75649d9cd91cf640edce9095a990bf6eed98501b | |
parent | 51bdbc8144c24d13e9c87c3fab923d9766e394e1 (diff) | |
download | hda-emu-1e7773d2bb5a0be8b0bc0562444562aaf8a3f801.tar.gz |
Avoid crash of reading an invalid number of nodes
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | hda-parse.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hda-parse.c b/hda-parse.c index 73658c5..bbe9935 100644 --- a/hda-parse.c +++ b/hda-parse.c @@ -264,6 +264,10 @@ static int parse_node_items(const char *buf) parse_mode = PARSE_NODE_PCM; } else if ((p = strmatch(head, "Connection: "))) { node->num_nodes = strtoul(p, NULL, 0); + if (node->num_nodes >= 128) { + hda_log(HDA_LOG_WARN, "Clearing invalid connection# %d @ NID 0x%x\n", node->num_nodes, node->nid); + node->num_nodes = 0; + } if (node->num_nodes) parse_mode = PARSE_NODE_CONNECTIONS; } |