Skip to content

Commit 8b06826

Browse files
committed
Fix the GCC build after _FORTIFY_SOURCE import
We haven't exposed gets(3) in a long time, rip out __gets_chk before it's too late and something builds a gets(3) user with it enabled.
1 parent b667c40 commit 8b06826

File tree

7 files changed

+2
-86
lines changed

7 files changed

+2
-86
lines changed

include/ssp/stdio.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ int __snprintf_chk(char *__restrict, size_t, int, size_t,
4848
int __vsnprintf_chk(char *__restrict, size_t, int, size_t,
4949
const char *__restrict, __va_list)
5050
__printflike(5, 0);
51-
char *__gets_chk(char *, size_t);
5251
char *__fgets_chk(char *, int, size_t, FILE *);
5352
__END_DECLS
5453

@@ -78,11 +77,6 @@ __END_DECLS
7877
fmt, ap); \
7978
})
8079

81-
#define gets(str) ({ \
82-
char *_ssp_str = (str); \
83-
__gets_chk(_ssp_str, __ssp_bos(_ssp_str)); \
84-
})
85-
8680
#define fgets(str, len, fp) ({ \
8781
char *_ssp_str = (str); \
8882
__fgets_chk(_ssp_str, len, __ssp_bos(_ssp_str), fp); \

lib/libc/secure/Makefile.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
.PATH: ${LIBC_SRCTOP}/secure
55

66
# _FORTIFY_SOURCE
7-
SRCS+= gets_chk.c fgets_chk.c memcpy_chk.c memmove_chk.c memset_chk.c \
7+
SRCS+= fgets_chk.c memcpy_chk.c memmove_chk.c memset_chk.c \
88
snprintf_chk.c sprintf_chk.c stpcpy_chk.c stpncpy_chk.c \
99
strcat_chk.c strcpy_chk.c strncat_chk.c strncpy_chk.c \
1010
vsnprintf_chk.c vsprintf_chk.c

lib/libc/secure/Symbol.map

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ FBSD_1.0 {
55
};
66

77
FBSD_1.8 {
8-
__gets_chk;
98
__fgets_chk;
109
__memcpy_chk;
1110
__memmove_chk;

lib/libc/secure/gets_chk.c

Lines changed: 0 additions & 74 deletions
This file was deleted.

lib/libssp/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ SHLIBDIR?= /lib
44
SHLIB= ssp
55
SHLIB_MAJOR= 0
66

7-
SSP_SRCS= gets_chk.c fgets_chk.c memcpy_chk.c memmove_chk.c memset_chk.c \
7+
SSP_SRCS= fgets_chk.c memcpy_chk.c memmove_chk.c memset_chk.c \
88
snprintf_chk.c sprintf_chk.c stpcpy_chk.c stpncpy_chk.c \
99
strcat_chk.c strcpy_chk.c strncat_chk.c strncpy_chk.c \
1010
vsnprintf_chk.c vsprintf_chk.c

lib/libssp/Symbol.map

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ LIBSSP_1.0 {
2020
};
2121

2222
LIBSSP_1.1 {
23-
__gets_chk;
2423
__fgets_chk;
2524
__memmove_chk;
2625
__stpncpy_chk;

lib/libssp/ssp.3

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@
4949
.Ft int
5050
.Fn vsnprintf "char *str" "size_t len" "const char *fmt" "va_list ap"
5151
.Ft char *
52-
.Fn gets "char *str"
53-
.Ft char *
5452
.Fn fgets "char *str" "int len" "FILE *fp"
5553
.In ssp/string.h
5654
.Ft void *

0 commit comments

Comments
 (0)