summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-12-18 10:24:39 -0600
committerTom Rini <[email protected]>2025-12-18 10:24:39 -0600
commit8d210fa37f49169c5ad0d46a7bc82aed59f51984 (patch)
tree527e246a9105130dcaf29c49fce3ad04f6958fbf /net
parent47b50fb1125c539d80ed3e7f739c02c6486e1b52 (diff)
parenta8a81af848b88d7ecee64d98a08f6415630305b3 (diff)
Merge tag 'net-20251218' of https://source.denx.de/u-boot/custodians/u-boot-net
Pull request net-20251218. net-lwip: - Avoid NULL dereference in _set_cacert() - Fix filename handling in TFTP
Diffstat (limited to 'net')
-rw-r--r--net/lwip/tftp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/lwip/tftp.c b/net/lwip/tftp.c
index 94bacf63075..6c7ffba661e 100644
--- a/net/lwip/tftp.c
+++ b/net/lwip/tftp.c
@@ -279,7 +279,7 @@ int do_tftpb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
if (!arg)
arg = net_boot_file_name;
- if (arg) {
+ if (*arg) {
/* Parse [ip:[port:]]fname */
i = 0;
while ((*(words + i) = strsep(&arg, ":")))
@@ -342,6 +342,7 @@ int do_tftpb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
if (tftp_loop(eth_get_dev(), laddr, fname, srvip, port) < 0)
ret = CMD_RET_FAILURE;
out:
- free(arg);
+ if (arg != net_boot_file_name)
+ free(arg);
return ret;
}