Skip to content

Commit 8e6a1ac

Browse files
riastradhriastradh
authored andcommitted
ctype(3): Fix versions and clarify what LIBC_ALLOWCTYPEABUSE does.
Both the extra diagnostics _and_ LIBC_ALLOWCTYPEABUSE are new in 11. The extra diagnostics were not added in 10 (unless someone went ahead and pulled them up while I wasn't looking!). LIBC_ALLOWCTYPEABUSE doesn't guarantee that the program won't crash; it just makes that depend on factors such as address space layout randomization -- where the ctype tables appear in memory relative to non-readable pages. PR lib/58208: ctype(3) provides poor runtime feedback of abuse
1 parent ca47813 commit 8e6a1ac

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/libc/gen/ctype.3

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.\" $NetBSD: ctype.3,v 1.34 2025/10/05 00:29:37 riastradh Exp $
1+
.\" $NetBSD: ctype.3,v 1.35 2025/10/05 00:35:47 riastradh Exp $
22
.\"
33
.\" Copyright (c) 1991 Regents of the University of California.
44
.\" All rights reserved.
@@ -62,18 +62,18 @@ See the specific manual pages for information about the
6262
test or conversion performed by each function.
6363
.Sh ENVIRONMENT
6464
In
65-
.Nx 10 ,
65+
.Nx 11 ,
6666
the
6767
.Nm
68-
functions will crash with a signal on certain invalid inputs as a
69-
diagnostic aid for applications; see
68+
functions will always crash with a signal on certain invalid inputs as
69+
a diagnostic aid for applications; see
7070
.Sx CAVEATS .
71-
In
72-
.Nx 11 ,
73-
setting the environment variable
71+
Setting the environment variable
7472
.Ev LIBC_ALLOWCTYPEABUSE
75-
before starting a program will make the functions return nonsense
76-
answers instead of crashing.
73+
before starting a program will restore the old behavior of returning
74+
nonsense answers for these inputs, or sometimes but not always
75+
crashing, depending on factors such as address space layout
76+
randomization.
7777
.Sh EXAMPLES
7878
To print an upper-case version of a string to stdout,
7979
the following code can be used:

0 commit comments

Comments
 (0)