Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: [netbsd-11] src



Module Name:    src
Committed By:   martin
Date:           Wed Oct  1 17:41:15 UTC 2025

Modified Files:
        src/distrib/sets/lists/debug [netbsd-11]: mi
        src/distrib/sets/lists/tests [netbsd-11]: mi
        src/lib/libc/gen [netbsd-11]: ctype.3 ctype_.c ctype_guard.h isctype.c
            tolower_.c toupper_.c
        src/lib/libc/locale [netbsd-11]: Makefile.inc rune.c
        src/tests/lib/libc/gen [netbsd-11]: Makefile t_ctype.c
Added Files:
        src/tests/lib/libc/gen [netbsd-11]: h_ctype_abuse.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #45):

        tests/lib/libc/gen/t_ctype.c: revision 1.12
        lib/libc/gen/ctype_.c: revision 1.24
        lib/libc/locale/rune.c: revision 1.50
        tests/lib/libc/gen/Makefile: revision 1.61
        lib/libc/gen/tolower_.c: revision 1.18
        lib/libc/gen/isctype.c: revision 1.29
        distrib/sets/lists/tests/mi: revision 1.1394
        lib/libc/gen/toupper_.c: revision 1.18
        lib/libc/gen/ctype_guard.h: revision 1.8
        lib/libc/locale/Makefile.inc: revision 1.69
        lib/libc/gen/ctype.3: revision 1.32
        lib/libc/gen/ctype.3: revision 1.33
        distrib/sets/lists/debug/mi: revision 1.486
        tests/lib/libc/gen/h_ctype_abuse.c: revision 1.1
        tests/lib/libc/gen/h_ctype_abuse.c: revision 1.2

ctype(3): New environment variable LIBC_ALLOWCTYPEABUSE.

If set, this does not force the ctype(3) functions to crash when
passed invalid inputs -- instead, they will return nonsense results,
and possibly print warnings to stderr, as is their right in
implementing undefined behaviour.

The nature of the nonsense results is unspecified.  Currently, is*()
will always return true (even if that leads to mutually contradictory
conclusions, like isalpha and isdigit, or isgraph and isblank), and
tolower/toupper() will always return EOF.  But perhaps in the future
the results may be randomized.

This way, if an application like firefox crashes on ctype abuse, you
can opt to accept the consequences of nonsense results instead by
running `env LIBC_ALLOWCTYPEABUSE= firefox' until the application is
fixed.

PR lib/58208: ctype(3) provides poor runtime feedback of abuse
ctype(3): Document LIBC_ALLOWCTYPEABUSE.

If this is pulled up to netbsd-11, we should tweak the text to make
it apply to 11 too.
PR lib/58208: ctype(3) provides poor runtime feedback of abuse

ctype(3): Fix build of tests on machines with unsigned char.
Could maybe phrase this better but this'll do for now.

PR lib/58208: ctype(3) provides poor runtime feedback of abuse


To generate a diff of this commit:
cvs rdiff -u -r1.485 -r1.485.2.1 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1387 -r1.1387.2.1 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.31 -r1.31.14.1 src/lib/libc/gen/ctype.3
cvs rdiff -u -r1.23 -r1.23.2.1 src/lib/libc/gen/ctype_.c
cvs rdiff -u -r1.7 -r1.7.2.1 src/lib/libc/gen/ctype_guard.h
cvs rdiff -u -r1.28 -r1.28.2.1 src/lib/libc/gen/isctype.c
cvs rdiff -u -r1.17 -r1.17.2.1 src/lib/libc/gen/tolower_.c \
    src/lib/libc/gen/toupper_.c
cvs rdiff -u -r1.68 -r1.68.2.1 src/lib/libc/locale/Makefile.inc
cvs rdiff -u -r1.49 -r1.49.2.1 src/lib/libc/locale/rune.c
cvs rdiff -u -r1.60 -r1.60.2.1 src/tests/lib/libc/gen/Makefile
cvs rdiff -u -r0 -r1.2.2.2 src/tests/lib/libc/gen/h_ctype_abuse.c
cvs rdiff -u -r1.11 -r1.11.2.1 src/tests/lib/libc/gen/t_ctype.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index