summaryrefslogtreecommitdiff
path: root/tools/firmware-utils/src
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2013-08-06 14:32:50 +0000
committerJohn Crispin <john@openwrt.org>2013-08-06 14:32:50 +0000
commit815d9334e2baaedae7a4b50ad5d968b105f231d8 (patch)
tree8d4f14fc82c896c31425bec9f71594d14e7a1778 /tools/firmware-utils/src
parentf835cb6cc40dd8b7290925d32bf7da89d84fb27c (diff)
downloadmtk-20170518-815d9334e2baaedae7a4b50ad5d968b105f231d8.zip
mtk-20170518-815d9334e2baaedae7a4b50ad5d968b105f231d8.tar.gz
mtk-20170518-815d9334e2baaedae7a4b50ad5d968b105f231d8.tar.bz2
firmware-utils: fix segfault introduced by v2 changes
Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com> SVN-Revision: 37724
Diffstat (limited to 'tools/firmware-utils/src')
-rw-r--r--tools/firmware-utils/src/mktplinkfw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/firmware-utils/src/mktplinkfw.c b/tools/firmware-utils/src/mktplinkfw.c
index 05e40c5..f6fdff4 100644
--- a/tools/firmware-utils/src/mktplinkfw.c
+++ b/tools/firmware-utils/src/mktplinkfw.c
@@ -811,7 +811,7 @@ static int build_fw(void)
int ret = EXIT_FAILURE;
int writelen = 0;
int hdr_len;
- if (board->hdr_version == HEADER_VERSION_V2)
+ if (board && board->hdr_version == HEADER_VERSION_V2)
hdr_len = sizeof(struct fw_header_v2);
else
hdr_len = sizeof(struct fw_header);
@@ -854,7 +854,7 @@ static int build_fw(void)
if (!strip_padding)
writelen = buflen;
- if (board->hdr_version == HEADER_VERSION_V2)
+ if (board && board->hdr_version == HEADER_VERSION_V2)
fill_header_v2(buf, writelen);
else
fill_header(buf, writelen);