Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: dev-libs/libxml2/files/libxml2-2.7.8-xpath-memory.patch

Issue 6776028: Upgrade libxml2 and its portage dependencies (Closed) Base URL: ssh://gitrw.chromium.org:9222/portage-stable.git@master
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 From 0cbeb50ee03ce582a0c979c70d8fbf030e270c37 Mon Sep 17 00:00:00 2001
2 From: Daniel Veillard <veillard@redhat.com>
3 Date: Mon, 15 Nov 2010 11:06:29 +0000
4 Subject: Fix a potential memory access error
5
6 in case of a previus allocation error
7 ---
8 diff --git a/xpath.c b/xpath.c
9 index 4d6826d..81e33f6 100644
10 --- a/xpath.c
11 +++ b/xpath.c
12 @@ -3575,13 +3575,13 @@ xmlXPathNodeSetAdd(xmlNodeSetPtr cur, xmlNodePtr val) {
13 } else if (cur->nodeNr == cur->nodeMax) {
14 xmlNodePtr *temp;
15
16 - cur->nodeMax *= 2;
17 - temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax *
18 + temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax * 2 *
19 sizeof(xmlNodePtr));
20 if (temp == NULL) {
21 xmlXPathErrMemory(NULL, "growing nodeset\n");
22 return;
23 }
24 + cur->nodeMax *= 2;
25 cur->nodeTab = temp;
26 }
27 if (val->type == XML_NAMESPACE_DECL) {
28 --
29 cgit v0.8.3.1
OLDNEW
« no previous file with comments | « dev-libs/libxml2/files/libxml2-2.7.8-xpath-freeing2.patch ('k') | dev-libs/libxml2/libxml2-2.7.8.ebuild » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698