summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorLuo Ji <ji.luo@nxp.com>2018-06-28 18:51:20 +0800
committerJi Luo <ji.luo@nxp.com>2018-08-20 21:25:48 +0800
commit484e0dca8bc61909458f8a3511c66bdccb19a24e (patch)
treebcaf7bd776f2381248aea5d33dec765c612f770b /net
parent4d693897945db29cd4a4fd53f71ad13e865c8420 (diff)
[iot] [coverity] Fix null dereferenced issues
Fix the null dereferenced issues from converity scan results. issue id: 3618300:Dereference after null check 3618364:Dereference after null check 3618463:Dereference after null check 3618470:Explicit null dereferenced 3618520:Dereference after null check Test: issue fixed by converity scan. Change-Id: I577ed094a1f9b493de61b84827c0e1157a4fbd2f Signed-off-by: Luo Ji <ji.luo@nxp.com>
Diffstat (limited to 'net')
-rw-r--r--net/net.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/net.c b/net/net.c
index 4259c9e321d..12951102c12 100644
--- a/net/net.c
+++ b/net/net.c
@@ -215,8 +215,11 @@ static int on_bootfile(const char *name, const char *value, enum env_op op,
switch (op) {
case env_op_create:
case env_op_overwrite:
- copy_filename(net_boot_file_name, value,
- sizeof(net_boot_file_name));
+ if (value == NULL)
+ return -1;
+ else
+ copy_filename(net_boot_file_name, value,
+ sizeof(net_boot_file_name));
break;
default:
break;