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)
This commit is contained in:
parent
f46707eb9a
commit
26248431c6
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/branches/2019Q3/; revision=511359
@ -3,6 +3,7 @@
|
||||
|
||||
PORTNAME= vnconvert
|
||||
PORTVERSION= 1.0
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= vietnamese
|
||||
MASTER_SITES= LOCAL/obrien
|
||||
DISTNAME= convert
|
||||
|
45
vietnamese/vnconvert/files/patch-vnconvert.c
Normal file
45
vietnamese/vnconvert/files/patch-vnconvert.c
Normal file
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user