Project

General

Profile

Actions

Bug #13032

closed

printf(3C) should talk about NULL string pointers

Added by Joshua M. Clulow over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
manpage - manual pages
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:

Description

The printf(3C) manual page has this to say on the subject of NULL pointers passed as the value argument for a %s conversion specifier:

An argument with a null value will yield undefined results.

This has not really been true since around 2009, when 6724478 was fixed in 9f773e28 -- though with an accompanying change to the documentation.

As noted in the original bug, everybody else prints some version of a diagnostic (null) string if passed a NULL pointer. It is unlikely that this could or should change again, so we should document and commit to that behaviour from now on.

Actions #1

Updated by Electric Monk over 3 years ago

  • Gerrit CR set to 854
Actions #2

Updated by Joshua M. Clulow over 3 years ago

  • Assignee set to John Gardner
Actions #3

Updated by Electric Monk over 3 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 9fff840dca14d75459a8240b19c931e2fec186c5

commit  9fff840dca14d75459a8240b19c931e2fec186c5
Author: John Gardner <jgardner100@hotmail.com>
Date:   2020-08-24T23:49:05.000Z

    13032 printf(3C) should talk about NULL string pointers
    Reviewed by: Robert Mustacchi <rm@fingolfin.org>
    Reviewed by: C Fraire <cfraire@me.com>
    Reviewed by: Andy Fiddaman <andy@omniosce.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF