/[packages]/updates/5/libplist/current/SOURCES/0002-Plug-memory-leaks-caused-by-unused-and-unfreed-buffer.patch
ViewVC logotype

Contents of /updates/5/libplist/current/SOURCES/0002-Plug-memory-leaks-caused-by-unused-and-unfreed-buffer.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1186922 - (show annotations) (download)
Fri Dec 29 04:22:08 2017 UTC (6 years, 3 months ago) by luigiwalser
File size: 1255 byte(s)
- 1.12
- library major is now 3
- add patches from opensuse to fix several security issues (mga#20232)

1 From 6a781e6f69cb820347bae02a1f947e6b01ccaa47 Mon Sep 17 00:00:00 2001
2 From: Nikias Bassen <nikias@gmx.li>
3 Date: Sat, 31 Jan 2015 20:21:07 +0100
4 Subject: [PATCH] bplist: Plug memory leaks caused by unused (and unfreed)
5 buffer
6
7 When parsing binary plists with BPLIST_DICT or BPLIST_ARRAY nodes that are
8 referenced multiple times in a particular file, a buffer was allocated that
9 was not used, and also not freed, thus causing memory leaks.
10 ---
11 src/bplist.c | 5 -----
12 1 file changed, 5 deletions(-)
13
14 diff --git a/src/bplist.c b/src/bplist.c
15 index cbe9481..5ddca26 100644
16 --- a/src/bplist.c
17 +++ b/src/bplist.c
18 @@ -584,14 +584,9 @@ static void* copy_plist_data(const void* src)
19 dstdata->strval = strdup(srcdata->strval);
20 break;
21 case PLIST_DATA:
22 - case PLIST_ARRAY:
23 dstdata->buff = (uint8_t*) malloc(sizeof(uint8_t) * srcdata->length);
24 memcpy(dstdata->buff, srcdata->buff, sizeof(uint8_t) * srcdata->length);
25 break;
26 - case PLIST_DICT:
27 - dstdata->buff = (uint8_t*) malloc(sizeof(uint8_t) * srcdata->length * 2);
28 - memcpy(dstdata->buff, srcdata->buff, sizeof(uint8_t) * srcdata->length * 2);
29 - break;
30 case PLIST_UID:
31 dstdata->intval = srcdata->intval;
32 break;

  ViewVC Help
Powered by ViewVC 1.1.30