[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] [PATCH] MHD_add_response_header: Check on passed nul
From: |
José Bollo |
Subject: |
Re: [libmicrohttpd] [PATCH] MHD_add_response_header: Check on passed nullptr |
Date: |
Fri, 28 Jan 2022 11:24:19 +0100 |
On Fri, 28 Jan 2022 11:15:20 +0100
Christian Grothoff <grothoff@gnunet.org> wrote:
> That is something you cannot guarantee in C, basically ever. Libraries
> always require that they are called with correct arguments. Sure, a
> NULL pointer could be detected, but calling a function with a NULL
> pointer that is not documented to accept one is a bug in the calling
> application and results in undefined (!) behavior. That is normal in C
> and in MHD's case the "desired" outcome. Just check for the NULL
> response object before calling the MHD function, it's better for
> everyone involved ;-).
+1