aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2013-08-06 14:32:50 +0000
committerJohn Crispin <blogic@openwrt.org>2013-08-06 14:32:50 +0000
commita66e96d2226e39c904085a1eb88fde75cb8c3169 (patch)
treed53644f7ea5b1d80847a9ff074a3973a33b3b492
parent8c6b586f4dd7453c2348836da197369c52d86e70 (diff)
downloadupstream-a66e96d2226e39c904085a1eb88fde75cb8c3169.tar.gz
upstream-a66e96d2226e39c904085a1eb88fde75cb8c3169.tar.bz2
upstream-a66e96d2226e39c904085a1eb88fde75cb8c3169.zip
firmware-utils: fix segfault introduced by v2 changes
Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37724 3c298f89-4303-0410-b956-a3cf2f4a3e73
-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 05e40c5daf..f6fdff4943 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);