aboutsummaryrefslogtreecommitdiff
path: root/lib/libstand/tftp.c
diff options
context:
space:
mode:
authorPaul Saab <ps@FreeBSD.org>2000-12-08 05:02:12 +0000
committerPaul Saab <ps@FreeBSD.org>2000-12-08 05:02:12 +0000
commit3894088f174dc432272318681468e5a8edaa0138 (patch)
tree6470d3a95a97cb5ce0f6f7aef1abd6d334f98bcc /lib/libstand/tftp.c
parentd5b14b2a372d25ed9f06ed1856a19283aee2ebb0 (diff)
downloadsrc-3894088f174dc432272318681468e5a8edaa0138.tar.gz
src-3894088f174dc432272318681468e5a8edaa0138.zip
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>
Notes
Notes: svn path=/head/; revision=69739
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 e7f885d9071d..3b481734716d 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);