C Language, Using fprintf() with a NULL-stream

Section 4.1.6 Use of Library Functions
Each of the following statements applies unless explicitly stated otherwise
in the detailed descriptions that follows. If an argument to a function has
an invalid value (such as a value outside the domain of the function, or a
pointer outside the address space of the program, or a null pointer), the
behavior is undefined. The fprintf Function {says nothing about a NULL stream} The sprintf Function {says nothing about a NULL buffer pointer}
Ergo, in both cases, the behavior is undefined.