svn commit: r344285 - stable/11/stand/common

Kyle Evans kevans at FreeBSD.org
Tue Feb 19 18:32:07 UTC 2019


Author: kevans
Date: Tue Feb 19 18:32:05 2019
New Revision: 344285
URL: https://svnweb.freebsd.org/changeset/base/344285

Log:
  MFC r332555: loader: provide values in help_getnext()
  
  With r328289 we attempt to make sure we free the resources allocated in
  help_getnext(), however, it is possible that we get no resources allocated
  and help_getnext() will return early.
  
  Make sure we have pointers set to NULL early in help_getnext().

Modified:
  stable/11/stand/common/commands.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/stand/common/commands.c
==============================================================================
--- stable/11/stand/common/commands.c	Tue Feb 19 18:30:37 2019	(r344284)
+++ stable/11/stand/common/commands.c	Tue Feb 19 18:32:05 2019	(r344285)
@@ -64,7 +64,9 @@ static int
 help_getnext(int fd, char **topic, char **subtopic, char **desc) 
 {
     char	line[81], *cp, *ep;
-    
+
+    /* Make sure we provide sane values. */
+    *topic = *subtopic = *desc = NULL;
     for (;;) {
 	if (fgetstr(line, 80, fd) < 0)
 	    return(0);


More information about the svn-src-all mailing list