Module Name:    src
Committed By:   bad
Date:           Sun Jan 20 21:26:13 UTC 2019

Modified Files:
        src/sys/kern: subr_tftproot.c

Log Message:
tftproot_getfile(): return E2BIG when bootfile is to long.

tftproot_getfile() must return something != 0 to indicate error when
the bootfile is to long.
error just got set to 0 when nfs_boot_setrecvtimo() was called.

found during code review. compile tested only.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/kern/subr_tftproot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/subr_tftproot.c
diff -u src/sys/kern/subr_tftproot.c:1.22 src/sys/kern/subr_tftproot.c:1.23
--- src/sys/kern/subr_tftproot.c:1.22	Sat Oct 27 09:13:45 2018
+++ src/sys/kern/subr_tftproot.c	Sun Jan 20 21:26:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_tftproot.c,v 1.22 2018/10/27 09:13:45 mlelstv Exp $ */
+/*	$NetBSD: subr_tftproot.c,v 1.23 2019/01/20 21:26:13 bad Exp $ */
 
 /*-
  * Copyright (c) 2007 Emmanuel Dreyfus, all rights reserved.
@@ -39,7 +39,7 @@
 #include "opt_md.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_tftproot.c,v 1.22 2018/10/27 09:13:45 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_tftproot.c,v 1.23 2019/01/20 21:26:13 bad Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -246,6 +246,7 @@ tftproot_getfile(struct tftproot_handle 
 	if (packetlen > MSIZE) {
 		DPRINTF(("%s():%d boot filename too long (%ld bytes)\n", 
 		    __func__, __LINE__, (long)namelen));
+		error = E2BIG;
 		goto out;
 	}
 

Reply via email to