Submitter: Douglas Walls
Submission Date: 2013-02-11
 Source: WG 14
Reference Document: 
N1672 
Version: 1.1
Date: October 2013
Subject: runtime-constraint issue with sprintf family of
routines in Annex K 
Summary
snprintf_s (Annex K.3.5.3.5)Suggested Technical Corrigendum
snprintf_s
Replace K.3.5.3.5p3 with:
  If there is a runtime-constraint violation, then if s is not
a null
  pointer and n is greater than zero and not greater than
RSIZE_MAX, then the
  snprintf_s function sets s[0] to the null character.
sprintf_s
Replace K.3.5.3.6p3 with:
  If there is a runtime-constraint violation, then if s is not
a null
  pointer and n is greater than zero and not greater than
RSIZE_MAX, then the
  sprintf_s function sets s[0] to the null character.
vsnprintf_s
Replace K.3.5.3.12p3 with:
  If there is a runtime-constraint violation, then if s is not
a null
  pointer and n is greater than zero and not greater than
RSIZE_MAX, then the
  vsnprintf_s function sets s[0] to the null character.
vsprintf_s
Replace K.3.5.3.13p3 with:
  If there is a runtime-constraint violation, then if s is not
a null
  pointer and n is greater than zero and not greater than
RSIZE_MAX, then the
  vsprintf_s function sets s[0] to the null character.
Committee Discussion
Committee Discussion
Proposed Technical Corrigendum
snprintf_s
Replace K.3.5.3.5p3 with:
  If there is a runtime-constraint violation, then if s is not
a null
  pointer and n is greater than zero and not greater than
RSIZE_MAX, then the
  snprintf_s function sets s[0] to the null character.
sprintf_s
Replace K.3.5.3.6p3 with:
  If there is a runtime-constraint violation, then if s is not
a null
  pointer and n is greater than zero and not greater than
RSIZE_MAX, then the
  sprintf_s function sets s[0] to the null character.
vsnprintf_s
Replace K.3.5.3.12p3 with:
  If there is a runtime-constraint violation, then if s is not
a null
  pointer and n is greater than zero and not greater than
RSIZE_MAX, then the
  vsnprintf_s function sets s[0] to the null character.
vsprintf_s
Replace K.3.5.3.13p3 with:
  If there is a runtime-constraint violation, then if s is not
a null
  pointer and n is greater than zero and not greater than
RSIZE_MAX, then the
  vsprintf_s function sets s[0] to the null character.