Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Aug 2018 16:44:56 +0000 (UTC)
From:      Ruslan Bukin <br@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r337266 - head/sys/riscv/riscv
Message-ID:  <201808031644.w73Giui2050008@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: br
Date: Fri Aug  3 16:44:56 2018
New Revision: 337266
URL: https://svnweb.freebsd.org/changeset/base/337266

Log:
  Return ENAMETOOLONG if the latest copied character
  is not null terminator.
  
  Sponsored by:	DARPA, AFRL

Modified:
  head/sys/riscv/riscv/copyinout.S

Modified: head/sys/riscv/riscv/copyinout.S
==============================================================================
--- head/sys/riscv/riscv/copyinout.S	Fri Aug  3 16:35:37 2018	(r337265)
+++ head/sys/riscv/riscv/copyinout.S	Fri Aug  3 16:44:56 2018	(r337266)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2015 Ruslan Bukin <br@bsdpad.com>
+ * Copyright (c) 2015-2018 Ruslan Bukin <br@bsdpad.com>
  * All rights reserved.
  *
  * Portions of this software were developed by SRI International and the
@@ -133,5 +133,8 @@ ENTRY(copyinstr)
 	sd	a5, 0(a3)	/* done = count */
 
 4:	mv	a0, x0		/* return 0 */
+	beqz	a4, 5f
+	li	a0, ENAMETOOLONG
+5:
 	ret
 END(copyinstr)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808031644.w73Giui2050008>