[Git][NTPsec/ntpsec][master] Address Gitlab issue #67: ntpq segfaults

Eric S. Raymond gitlab at mg.gitlab.com
Tue May 31 06:06:33 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
f88bcb8d by Eric S. Raymond at 2016-05-31T02:06:16-04:00
Address Gitlab issue #67: ntpq segfaults

Failing early and loudly on invalid command line switches avoids trouble.

- - - - -


1 changed file:

- ntpq/ntpq.c


Changes:

=====================================
ntpq/ntpq.c
=====================================
--- a/ntpq/ntpq.c
+++ b/ntpq/ntpq.c
@@ -542,8 +542,8 @@ ntpqmain(
 			break;
 		    default :
 			/* chars not in table get converted to ? */
-			printf("Unknown command line switch ignored.\n");
-			break;
+			printf("Command line switch ignored or missing an argument.\n");
+			exit(1);
 		    } /*switch*/
 		}
 



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/f88bcb8d3c9c6f7525b4b20ff37d22951ba15986
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160531/98acbe0d/attachment.html>


More information about the vc mailing list