diff options
author | Kai Knoblich <kai@FreeBSD.org> | 2019-09-06 20:06:03 +0000 |
---|---|---|
committer | Kai Knoblich <kai@FreeBSD.org> | 2019-09-06 20:06:03 +0000 |
commit | 26248431c62fa50f63e1ec4ac285ebc8db14838b (patch) | |
tree | 4546f0e521a7392d24910a4069b65a48c013ae94 | |
parent | f46707eb9a12e2a9bb03592dcce73803977abdc0 (diff) | |
download | ports-26248431c62fa50f63e1ec4ac285ebc8db14838b.tar.gz ports-26248431c62fa50f63e1ec4ac285ebc8db14838b.zip |
MFH: r511321
vietnamese/vnconvert: Replace gets(3) with gets_s(3)
The long deprecated and unsafe gets(3) function has been removed since
FreeBSD 1300043.
Thus replace the occurences of that function in the code with gets_s(3)
which is a safer alternative.
* Bump PORTREVISION due to changes in the code/package.
PR: 238687
Reported by: emaste
Approved by: ports-secteam (joneum)
Notes
Notes:
svn path=/branches/2019Q3/; revision=511359
-rw-r--r-- | vietnamese/vnconvert/Makefile | 1 | ||||
-rw-r--r-- | vietnamese/vnconvert/files/patch-vnconvert.c | 45 |
2 files changed, 46 insertions, 0 deletions
diff --git a/vietnamese/vnconvert/Makefile b/vietnamese/vnconvert/Makefile index 2f30b414f4ee..3b0813e9d237 100644 --- a/vietnamese/vnconvert/Makefile +++ b/vietnamese/vnconvert/Makefile @@ -3,6 +3,7 @@ PORTNAME= vnconvert PORTVERSION= 1.0 +PORTREVISION= 1 CATEGORIES= vietnamese MASTER_SITES= LOCAL/obrien DISTNAME= convert diff --git a/vietnamese/vnconvert/files/patch-vnconvert.c b/vietnamese/vnconvert/files/patch-vnconvert.c new file mode 100644 index 000000000000..eb99f9e53243 --- /dev/null +++ b/vietnamese/vnconvert/files/patch-vnconvert.c @@ -0,0 +1,45 @@ +--- vnconvert.c.orig 1994-05-20 20:36:17 UTC ++++ vnconvert.c +@@ -91,7 +91,7 @@ main() + printf("\t6 - VN Thin-Art (Mac)\n\n"); + + printf("Input-file name (or Enter to quit): "); +- gets(bufline); ++ gets_s(bufline, 255); + if (strlen(bufline) == 0) + break; + sscanf(bufline, "%s", input_file); +@@ -99,21 +99,21 @@ main() + printf("currently in the format number: "); + *bufline = '\0'; + while (strlen(bufline)==0) { +- gets(bufline); ++ gets_s(bufline, 255); + sscanf(bufline, "%d", &from); + } + + printf("\nOutput-file name: "); + *bufline = '\0'; + while (strlen(bufline)==0) { +- gets(bufline); ++ gets_s(bufline, 255); + sscanf(bufline, "%s", output_file); + } + + printf("to the format number: "); + *bufline = '\0'; + while (strlen(bufline)==0) { +- gets(bufline); ++ gets_s(bufline, 255); + sscanf(bufline, "%d", &to); + } + +@@ -152,7 +152,7 @@ main() + } + else { + fprintf(stderr, "\"%s\" already exists. Overwrite it (y/n)? ", output_file); +- gets(buf); ++ gets_s(buf, BUFSIZ); + if (toupper(buf[0]) != 'Y') + icontinue = 1; + } |