Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Apr 2019 19:12:48 +0000 (UTC)
From:      Enji Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r346912 - stable/12/lib/libc/tests/sys
Message-ID:  <201904291912.x3TJCmUw067123@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Mon Apr 29 19:12:47 2019
New Revision: 346912
URL: https://svnweb.freebsd.org/changeset/base/346912

Log:
  MFC r346539:
  
  Fix `get_int_via_sysctlbyname(..)` on Jenkins
  
  Initialize `oldlen` to the size of the value, instead of leaving the value
  unitialized. Leaving it unitialized seems to work by accident on amd64 when
  running 64-bit programs, but not on i386.
  
  This matches patterns in use in other programs.
  
  PR:		237458
  Tested on:	^/head (amd64), ^/stable/11 (i386)

Modified:
  stable/12/lib/libc/tests/sys/sendfile_test.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libc/tests/sys/sendfile_test.c
==============================================================================
--- stable/12/lib/libc/tests/sys/sendfile_test.c	Mon Apr 29 19:11:56 2019	(r346911)
+++ stable/12/lib/libc/tests/sys/sendfile_test.c	Mon Apr 29 19:12:47 2019	(r346912)
@@ -62,6 +62,8 @@ get_int_via_sysctlbyname(const char *oidname)
 	size_t oldlen;
 	int int_value;
 
+	oldlen = sizeof(int_value);
+
 	ATF_REQUIRE_EQ_MSG(sysctlbyname(oidname, &int_value, &oldlen, NULL, 0),
 	    0, "sysctlbyname(%s, ...) failed: %s", oidname, strerror(errno));
 	ATF_REQUIRE_EQ_MSG(sizeof(int_value), oldlen, "sanity check failed");



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