Skip to content
  • Ralph Holmes's avatar
    Fix execl(3) sentinel undefined behaviour. · 5d774cce
    Ralph Holmes authored and Jonas Termansen's avatar Jonas Termansen committed
    execl(3) and its variants use a sentinel to terminate the variadic
    argument list, in the form of a null pointer constant of type pointer to
    char. POSIX mandates that NULL is a null pointer constant of type
    pointer to void, which is not of an equivalent type to that required by
    execl(3) and its variants, resulting in undefined behaviour.
    
    This commit casts all such instances of NULL to pointer to char type.
    For consistency, it also adds const-qualification to any such instances
    which had already been casted, and were not const-qualified.
    5d774cce