tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

varargs bug in libedit



I've commmitted the following to FreeBSD's copy of libedit.  It fixes a
bug in varargs handling in el_get().  It's harmless for most
architectures, but our CHERI architecture turns it into a failure.

-- Brooks

----- Forwarded message from Brooks Davis <brooks%FreeBSD.org@localhost> -----

Date: Mon, 2 Nov 2015 22:21:02 +0000 (UTC)
From: Brooks Davis <brooks%FreeBSD.org@localhost>
To: src-committers%freebsd.org@localhost, svn-src-all%freebsd.org@localhost,
	svn-src-head%freebsd.org@localhost
Subject: svn commit: r290298 - head/lib/libedit

Author: brooks
Date: Mon Nov  2 22:21:02 2015
New Revision: 290298
URL: https://svnweb.freebsd.org/changeset/base/290298

Log:
  The ops EL_SIGNAL, EL_EDITMODE, EL_UNBUFFERED, and EL_PREP_TERM all take
  an int, not an int*.
  
  Sponsored by:	DARPA, AFRL
  Discovered with:	CHERI
  Differential Revision:	https://reviews.freebsd.org/D4071

Modified:
  head/lib/libedit/eln.c

Modified: head/lib/libedit/eln.c
==============================================================================
--- head/lib/libedit/eln.c	Mon Nov  2 22:12:51 2015	(r290297)
+++ head/lib/libedit/eln.c	Mon Nov  2 22:21:02 2015	(r290298)
@@ -325,11 +325,11 @@ el_get(EditLine *el, int op, ...)
 		ret = el_wget(el, op, va_arg(ap, const char **));
 		break;
 
-	case EL_SIGNAL:         /* int * */
+	case EL_SIGNAL:         /* int */
 	case EL_EDITMODE:
 	case EL_UNBUFFERED:
 	case EL_PREP_TERM:
-		ret = el_wget(el, op, va_arg(ap, int *));
+		ret = el_wget(el, op, va_arg(ap, int));
 		break;
 
 	case EL_GETTC: {


----- End forwarded message -----


Home | Main Index | Thread Index | Old Index