The functions specified by the user might be longer than the function in
the backtrace, potentially overflowing the memcmp(). In practice, it
should not be a relevant out-of-memory read. However, we can use
strncmp() instead.
Note that, as before, this is only a prefix match. If a function name is
longer in the backtrace it will still match.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
len = next - pos;
else
len = os_strlen(pos);
- if (os_memcmp(pos, func[i], len) != 0) {
+ if (os_strncmp(pos, func[i], len) != 0) {
if (maybe && next) {
pos = next + 1;
continue;