Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Sep 2019 15:41:15 +0000 (UTC)
From:      Kai Knoblich <kai@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r511321 - in head/vietnamese/vnconvert: . files
Message-ID:  <201909061541.x86FfFYU020097@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kai
Date: Fri Sep  6 15:41:15 2019
New Revision: 511321
URL: https://svnweb.freebsd.org/changeset/ports/511321

Log:
  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
  MFH:		2019Q3

Added:
  head/vietnamese/vnconvert/files/patch-vnconvert.c   (contents, props changed)
Modified:
  head/vietnamese/vnconvert/Makefile

Modified: head/vietnamese/vnconvert/Makefile
==============================================================================
--- head/vietnamese/vnconvert/Makefile	Fri Sep  6 15:00:44 2019	(r511320)
+++ head/vietnamese/vnconvert/Makefile	Fri Sep  6 15:41:15 2019	(r511321)
@@ -3,6 +3,7 @@
 
 PORTNAME=	vnconvert
 PORTVERSION=	1.0
+PORTREVISION=	1
 CATEGORIES=	vietnamese
 MASTER_SITES=	LOCAL/obrien
 DISTNAME=	convert

Added: head/vietnamese/vnconvert/files/patch-vnconvert.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/vietnamese/vnconvert/files/patch-vnconvert.c	Fri Sep  6 15:41:15 2019	(r511321)
@@ -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;
+ 			}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909061541.x86FfFYU020097>