mailing list of musl libc
 help / color / mirror / code / Atom feed
d74af61afc38cdae05d54a5f46cb9fafcd7bc8c5 blob 1368 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
 
#include <stdio.h>
#include <stdarg.h>
#include "atomic.h"

int __fprintf_chk(FILE *f, int flag, const char *fmt, ...)
{
	int ret;
	va_list ap;
	va_start(ap, fmt);
	ret = vfprintf(f, fmt, ap);
	va_end(ap);
	return ret;
}

int __printf_chk(int flag, const char *fmt, ...)
{
	int ret;
	va_list ap;
	va_start(ap, fmt);
	ret = vfprintf(stdout, fmt, ap);
	va_end(ap);
	return ret;
}

int __snprintf_chk(char *s, size_t n, int flag, size_t slen, const char *fmt, ...)
{
	int ret;
	va_list ap;
	if (n > slen) a_crash();
	ret = vsnprintf(s, slen, fmt, ap);
	va_end(ap);
	return ret;
}

int __sprintf_chk(char *s, int flag, size_t slen, const char *fmt, ...)
{
	int ret;
	va_list ap;
	if (slen == 0) a_crash();
	va_start(ap, fmt);
	ret = vsnprintf(s, slen, fmt, ap);
	va_end(ap);
	if (ret > slen) a_crash();
	return ret;
}

int __vfprintf_chk(FILE *f, int flag, const char *fmt, va_list ap)
{
	return vfprintf(f, fmt, ap);
}

int __vprintf_chk(int flag, const char *fmt, va_list ap)
{
	return vfprintf(stdout, fmt, ap);
}

int __vsnprintf_chk(char *s, size_t n, int flag, size_t slen, const char *fmt, va_list ap)
{
	if (n > slen) a_crash();
	return vsnprintf(s, n, fmt, ap);
}

int __vsprintf_chk(char *s, int flag, size_t slen, const char *fmt, va_list ap)
{
	int ret;
	if (slen == 0) a_crash();
	ret = vsnprintf(s, slen, fmt, ap);
	if (ret > slen) a_crash();
	return ret;
}
debug log:

solving d74af61 ...
found d74af61 in https://inbox.vuxu.org/musl/1434509291-28997-1-git-send-email-josiahw@gmail.com/

applying [1/1] https://inbox.vuxu.org/musl/1434509291-28997-1-git-send-email-josiahw@gmail.com/
diff --git a/src/compat/printf_chk.c b/src/compat/printf_chk.c
new file mode 100644
index 0000000..d74af61

Checking patch src/compat/printf_chk.c...
Applied patch src/compat/printf_chk.c cleanly.

index at:
100644 d74af61afc38cdae05d54a5f46cb9fafcd7bc8c5	src/compat/printf_chk.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).