Bug 221323 - memset_s() and abort_handler_s() missed some standard notes
Summary: memset_s() and abort_handler_s() missed some standard notes
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-standards (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-08-08 00:24 UTC by Yuri Pankov
Modified: 2017-10-13 13:49 UTC (History)
3 users (show)

See Also:


Attachments
patch to correct the mentioned issues, updating the memset_s test case as well (2.38 KB, patch)
2017-08-08 00:24 UTC, Yuri Pankov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Pankov 2017-08-08 00:24:44 UTC
Created attachment 185140 [details]
patch to correct the mentioned issues, updating the memset_s test case as well

abort_handler_s() currently simply calls abort(), though the documentation says it needs to do more work - "Writes an implementation-defined message to stderr which must include the string pointed to by msg and calls abort()."

memset_s() is missing the fact that it should treat "n > smax" condition as error, and invoke the constraint handler after filling the buffer - "following errors are detected at runtime and call the currently installed constraint handler function after storing ch in every location of the destination range [dest, dest+destsz) if dest and destsz are themselves valid", one of the errors is "n > smax" itself.
Comment 1 Konstantin Belousov freebsd_committer 2017-08-08 10:21:19 UTC
Could you put the patch at reviews.freebsd.org, please ?  I have several questions and small notes that I want to discuss before committing the change.
Comment 2 Yuri Pankov 2017-08-11 19:20:13 UTC
Done: https://reviews.freebsd.org/D11991
Comment 3 Ed Maste freebsd_committer 2017-10-13 13:49:36 UTC
Committed in r322427