From 4b43b375b7abae22070cd86bfc26a8222233150e Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Wed, 31 Jan 2024 13:24:56 -0500 Subject: check for overlapping pointers --- src/stdio/setbuf.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/stdio/setbuf.c') diff --git a/src/stdio/setbuf.c b/src/stdio/setbuf.c index ddf38856..38072548 100644 --- a/src/stdio/setbuf.c +++ b/src/stdio/setbuf.c @@ -8,6 +8,7 @@ void setbuf(FILE * restrict stream, char * restrict buf) SIGNAL_SAFE(0); if (buf) { + ASSERT_NOOVERLAP(stream, sizeof(*stream), buf, BUFSIZ); setvbuf(stream, buf, _IOFBF, BUFSIZ); } else { setvbuf(stream, NULL, _IONBF, 0); -- cgit v1.2.1