summaryrefslogtreecommitdiffstats
path: root/lib/libstand/tftp.c
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2000-12-08 05:02:12 +0000
committerps <ps@FreeBSD.org>2000-12-08 05:02:12 +0000
commitb9f1a189bc92d2655153b1777fab1e728be86097 (patch)
treef7e7a79f03c3383725a317be9e41007353fc13c6 /lib/libstand/tftp.c
parent9286fe07da8f5b14a0ebd2b3885aa7866f64a48c (diff)
downloadFreeBSD-src-b9f1a189bc92d2655153b1777fab1e728be86097.zip
FreeBSD-src-b9f1a189bc92d2655153b1777fab1e728be86097.tar.gz
When TFTP tries to open a file, it is expecting struct open_file
member f_devdata to be a pointer to a socket number. When currdev is "pxe", that assumption is correct. When currdev is "disk*", that assumption is incorrect. Submitted by: Jim Browne <jbrowne@jbrowne.com>
Diffstat (limited to 'lib/libstand/tftp.c')
-rw-r--r--lib/libstand/tftp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libstand/tftp.c b/lib/libstand/tftp.c
index e7f885d..3b48173 100644
--- a/lib/libstand/tftp.c
+++ b/lib/libstand/tftp.c
@@ -256,6 +256,9 @@ tftp_open(path, f)
return (ENOMEM);
tftpfile->iodesc = io = socktodesc(*(int *) (f->f_devdata));
+ if (io == NULL)
+ return (EINVAL);
+
io->destip = servip;
tftpfile->off = 0;
tftpfile->path = strdup(path);
OpenPOWER on IntegriCloud