Anonymous | Login | 2024-12-12 16:25 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||
ID | Category | Severity | Type | Date Submitted | Last Update | ||
0001496 | [1003.1(2013)/Issue7+TC1] System Interfaces | Comment | Enhancement Request | 2021-08-01 17:09 | 2024-06-11 08:54 | ||
Reporter | alanc | View Status | public | ||||
Assigned To | |||||||
Priority | normal | Resolution | Accepted As Marked | ||||
Status | Closed | ||||||
Name | Alan Coopersmith | ||||||
Organization | Oracle Solaris Engineering | ||||||
User Reference | |||||||
Section | printf() | ||||||
Page Number | (page or range of pages) | ||||||
Line Number | (Line or range of lines) | ||||||
Interp Status | --- | ||||||
Final Accepted Text | See Note: 0005543 | ||||||
Summary | 0001496: Add asprintf() and vasprintf() | ||||||
Description |
The GNU C library has provided asprintf() and vasprintf() since at least 1991, and many other OS'es have added them as well since. These variants of sprintf() allocate new memory for the string, making it easier to have a safe usage without having to re-implement much of the printf format string handling logic to determine how much memory to allocate. These have been widely adopted in software trying to avoid buffer overflows: codesearch.debian.net finds 1713 software packages referencing asprintf(). GNU C library documentation: https://www.gnu.org/software/libc/manual/html_node/Dynamic-Output.html [^] FreeBSD man page (added in 2.2 in 1997): https://www.freebsd.org/cgi/man.cgi?query=asprintf [^] OpenBSD man page (added in 2.3 in 1998): https://man.openbsd.org/asprintf.3 [^] NetBSD man page: https://man.netbsd.org/asprintf.3 [^] Solaris man page (added in Solaris 10 Update 10 in 2011): https://docs.oracle.com/cd/E88353_01/html/E37843/asprintf-3c.html [^] illumos man page: https://illumos.org/man/3c/asprintf [^] |
||||||
Desired Action |
These functions should be added to the standard: #include <stdio.h> int asprintf(char **restrict strp, const char *restrict fmt, ...); int vasprintf(char **restrict strp, const char *restrict fmt, va_list ap); |
||||||
Tags | issue8 | ||||||
Attached Files | tr24731-2.pdf [^] (81,033 bytes) 2021-12-02 16:17 | ||||||
|
Issue History | |||
Date Modified | Username | Field | Change |
2021-08-01 17:09 | alanc | New Issue | |
2021-08-01 17:09 | alanc | Name | => Alan Coopersmith |
2021-08-01 17:09 | alanc | Organization | => Oracle Solaris Engineering |
2021-08-01 17:09 | alanc | Section | => printf() |
2021-08-01 17:09 | alanc | Page Number | => (page or range of pages) |
2021-08-01 17:09 | alanc | Line Number | => (Line or range of lines) |
2021-08-02 16:31 | jsm28 | Note Added: 0005427 | |
2021-08-03 19:19 | alanc | Note Added: 0005428 | |
2021-12-02 16:17 | nick | File Added: tr24731-2.pdf | |
2021-12-02 16:19 | nick | Note Added: 0005540 | |
2021-12-05 12:48 | nick | Note Added: 0005543 | |
2021-12-05 12:49 | nick | Note Edited: 0005543 | |
2021-12-05 12:49 | nick | Note Edited: 0005543 | |
2021-12-05 12:50 | nick | Note View State: public: 5543 | |
2021-12-05 12:50 | nick | Note Edited: 0005543 | |
2021-12-09 16:39 | nick | Note Edited: 0005543 | |
2021-12-09 16:40 | nick | Interp Status | => --- |
2021-12-09 16:40 | nick | Final Accepted Text | => See Note: 0005543 |
2021-12-09 16:40 | nick | Status | New => Resolved |
2021-12-09 16:40 | nick | Resolution | Open => Accepted As Marked |
2021-12-09 16:40 | nick | Tag Attached: issue8 | |
2022-01-13 10:05 | geoffclare | Status | Resolved => Applied |
2024-06-11 08:54 | agadmin | Status | Applied => Closed |
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |