commit | fc47300ed25a6cd0b642877c92f4e350a7d92d25 | [log] [tgz] |
---|---|---|
author | Jon Nalley <lists@bluebot.org> | Wed Feb 26 11:32:21 2014 -0500 |
committer | Tom Rini <trini@ti.com> | Thu Jun 19 11:18:42 2014 -0400 |
tree | f1e25e955326b5670fc39f08d39047cc3a78e249 | |
parent | daad3612e7b89b2b5d0773b28bb8e12dd097e15b [diff] |
libfdt: Fix segfault when calling fit_check_format() on corrupt FIT images It has been observed that fit_check_format() will fail when passed a corrupt FIT image. This was tracked down to _fdt_string_eq(): return (strlen(p) == len) && (memcmp(p, s, len) == 0); In the case of a corrupt FIT image one can't depend on 'p' being NULL terminated. I changed it to use strnlen() to fix the issue. Signed-off-by: Tom Rini <trini@ti.com>