diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2019-03-13 01:36:33 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-03-13 01:36:32 -0700 |
| commit | e556e69bfb9134cdcc7e81fe1ded4725249cd216 (patch) | |
| tree | 1b168383dd9212f0f4e62422f3bf3c6c84dfbaae /lib | |
| parent | 1d932c57e221f3d40a1b0468371132711177f6b3 (diff) | |
| parent | caf53b2661cf5a9863048b7af89bd89a8ad0d282 (diff) | |
Merge "soc: qcom: qmi_encdec: Restrict string length in decode"
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/qmi_encdec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/qmi_encdec.c b/lib/qmi_encdec.c index 72b506bececc..9d5c446830ed 100644 --- a/lib/qmi_encdec.c +++ b/lib/qmi_encdec.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2015, 2019 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -710,8 +710,8 @@ static int qmi_decode_string_elem(struct elem_info *ei_array, void *buf_dst, decoded_bytes += rc; } - if (string_len > temp_ei->elem_len) { - pr_err("%s: String len %d > Max Len %d\n", + if (string_len >= temp_ei->elem_len) { + pr_err("%s: String len %d >= Max Len %d\n", __func__, string_len, temp_ei->elem_len); return -ETOOSMALL; } else if (string_len > tlv_len) { |
