summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/libntp/ntp_lineedit.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2016-01-08 15:53:48 +0000
committerdelphij <delphij@FreeBSD.org>2016-01-08 15:53:48 +0000
commit31ece5769d393d00720a55b05dd7b3e85c2fcc52 (patch)
treeeb428181ad7f992dbbff39c2be903eaab7149cfb /contrib/ntp/libntp/ntp_lineedit.c
parent72bd55ca76570ee190062912e8f0350831baca6f (diff)
parent8518518f8f222e4d58e27928a988f034b82bbb77 (diff)
downloadFreeBSD-src-31ece5769d393d00720a55b05dd7b3e85c2fcc52.zip
FreeBSD-src-31ece5769d393d00720a55b05dd7b3e85c2fcc52.tar.gz
MFV r293415:
ntp 4.2.8p5 Reviewed by: cy, roberto Relnotes: yes Differential Revision: https://reviews.freebsd.org/D4828
Diffstat (limited to 'contrib/ntp/libntp/ntp_lineedit.c')
-rw-r--r--contrib/ntp/libntp/ntp_lineedit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/ntp/libntp/ntp_lineedit.c b/contrib/ntp/libntp/ntp_lineedit.c
index a2b2d29..ebd456a 100644
--- a/contrib/ntp/libntp/ntp_lineedit.c
+++ b/contrib/ntp/libntp/ntp_lineedit.c
@@ -29,6 +29,7 @@
#include "ntp.h"
#include "ntp_stdlib.h"
#include "ntp_lineedit.h"
+#include "safecast.h"
#define MAXEDITLINE 512
@@ -213,7 +214,7 @@ ntp_readline(
line = fgets(line_buf, sizeof(line_buf), stdin);
if (NULL != line && *line) {
- *pcount = strlen(line);
+ *pcount = (int)strlen(line); /* cannot overflow here */
line = estrdup(line);
} else
line = NULL;
OpenPOWER on IntegriCloud