diff options
Diffstat (limited to 'meta/recipes-extended/libtirpc/libtirpc-0.2.2/libtirpc-0.2.1-fortify.patch')
-rw-r--r-- | meta/recipes-extended/libtirpc/libtirpc-0.2.2/libtirpc-0.2.1-fortify.patch | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/meta/recipes-extended/libtirpc/libtirpc-0.2.2/libtirpc-0.2.1-fortify.patch b/meta/recipes-extended/libtirpc/libtirpc-0.2.2/libtirpc-0.2.1-fortify.patch new file mode 100644 index 0000000000..32644b5b72 --- /dev/null +++ b/meta/recipes-extended/libtirpc/libtirpc-0.2.2/libtirpc-0.2.1-fortify.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | Fix a possible overflow (reported by _FORTIFY_SOURCE=2) | ||
2 | |||
3 | Ported from Gentoo | ||
4 | |||
5 | Upstream-Status: Unknown | ||
6 | |||
7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
8 | |||
9 | Index: libtirpc-0.2.1/src/getrpcport.c | ||
10 | =================================================================== | ||
11 | --- libtirpc-0.2.1.orig/src/getrpcport.c | ||
12 | +++ libtirpc-0.2.1/src/getrpcport.c | ||
13 | @@ -54,11 +54,11 @@ getrpcport(host, prognum, versnum, proto | ||
14 | |||
15 | if ((hp = gethostbyname(host)) == NULL) | ||
16 | return (0); | ||
17 | + if (hp->h_length != sizeof(addr.sin_addr.s_addr)) | ||
18 | + return (0); | ||
19 | memset(&addr, 0, sizeof(addr)); | ||
20 | addr.sin_family = AF_INET; | ||
21 | addr.sin_port = 0; | ||
22 | - if (hp->h_length > sizeof(addr)) | ||
23 | - hp->h_length = sizeof(addr); | ||
24 | memcpy(&addr.sin_addr.s_addr, hp->h_addr, (size_t)hp->h_length); | ||
25 | /* Inconsistent interfaces need casts! :-( */ | ||
26 | return (pmap_getport(&addr, (u_long)prognum, (u_long)versnum, | ||