summaryrefslogtreecommitdiff
path: root/tools/firmware-utils
diff options
context:
space:
mode:
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-08-06 14:32:50 +0000
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-08-06 14:32:50 +0000
commit8acf2418584456bac73369ccb27bb012887bdef8 (patch)
treed53644f7ea5b1d80847a9ff074a3973a33b3b492 /tools/firmware-utils
parentf952025bed949bc78a2db8aa4b77929f76a698b9 (diff)
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
Diffstat (limited to 'tools/firmware-utils')
-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);