lib: qmi: Fix decoding logic for nested structures
While decoding a subset of QMI message that maps to an array of nested
structures, the decodable length is equally split across each structure
instance in that array. This is not correct when the nested structure holds
a variable length element.
1) Use the entire decodable length for each structure instance.
2) Update the decodable length after decoding for each structure instance.
3) Check the decoded length does not overrun the decodable length after
decoding for each structure instance.
Change-Id: I58aad07010fe6961379f3f04a3cebf3f1c4a1bf8
Signed-off-by:
Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Loading
Please register or sign in to comment