mirror of
https://github.com/linux-msm/qmic.git
synced 2024-11-23 09:44:06 +08:00
parser: check the proper token number
In qmi_message_parse(), a check is made to ensure members defined
for a message are unique, both in name and number. But the number
that's used in the comparison is the type token number, but should
be the member number token number. Fix this bug.
Fixes: 72d1687
("parser: disallow duplicate members")
Signed-off-by: Alex Elder <elder@linaro.org>
This commit is contained in:
parent
ed896c97dc
commit
4937e55261
2
parser.c
2
parser.c
@ -492,7 +492,7 @@ static void qmi_message_parse(enum message_type message_type)
|
||||
if (!strcmp(qmm->name, id_tok.str))
|
||||
yyerror("duplicate message member \"%s\"",
|
||||
qmm->name);
|
||||
if (qmm->id == type_tok.num)
|
||||
if (qmm->id == num_tok.num)
|
||||
yyerror("duplicate message member number %u",
|
||||
qmm->id);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user