1 |
solar 09/08/29 19:43:14 |
2 |
|
3 |
Modified: qdepends.c |
4 |
Log: |
5 |
- fix crash in qdepends. Bug 263892 |
6 |
|
7 |
Revision Changes Path |
8 |
1.48 portage-utils/qdepends.c |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/portage-utils/qdepends.c?rev=1.48&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/portage-utils/qdepends.c?rev=1.48&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/portage-utils/qdepends.c?r1=1.47&r2=1.48 |
13 |
|
14 |
Index: qdepends.c |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-projects/portage-utils/qdepends.c,v |
17 |
retrieving revision 1.47 |
18 |
retrieving revision 1.48 |
19 |
diff -u -r1.47 -r1.48 |
20 |
--- qdepends.c 14 Mar 2008 23:24:47 -0000 1.47 |
21 |
+++ qdepends.c 29 Aug 2009 19:43:14 -0000 1.48 |
22 |
@@ -1,7 +1,7 @@ |
23 |
/* |
24 |
* Copyright 2005-2007 Gentoo Foundation |
25 |
* Distributed under the terms of the GNU General Public License v2 |
26 |
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qdepends.c,v 1.47 2008/03/14 23:24:47 solar Exp $ |
27 |
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qdepends.c,v 1.48 2009/08/29 19:43:14 solar Exp $ |
28 |
* |
29 |
* Copyright 2005-2007 Ned Ludd - <solar@g.o> |
30 |
* Copyright 2005-2007 Mike Frysinger - <vapier@g.o> |
31 |
@@ -30,7 +30,7 @@ |
32 |
"Show all DEPEND info", |
33 |
COMMON_OPTS_HELP |
34 |
}; |
35 |
-static const char qdepends_rcsid[] = "$Id: qdepends.c,v 1.47 2008/03/14 23:24:47 solar Exp $"; |
36 |
+static const char qdepends_rcsid[] = "$Id: qdepends.c,v 1.48 2009/08/29 19:43:14 solar Exp $"; |
37 |
#define qdepends_usage(ret) usage(ret, QDEPENDS_FLAGS, qdepends_long_opts, qdepends_opts_help, lookup_applet_idx("qdepends")) |
38 |
|
39 |
static char qdep_name_only = 0; |
40 |
@@ -293,10 +293,11 @@ |
41 |
{ |
42 |
if (root->neighbor) dep_prune_use(root->neighbor, use); |
43 |
if (root->type == DEP_USE) { |
44 |
- char useflag[40+3]; /* use flags shouldnt be longer than 40 ... */ |
45 |
+ char *useflag = NULL; |
46 |
int notfound, invert = (root->info[0] == '!' ? 1 : 0); |
47 |
- sprintf(useflag, " %s ", root->info+invert); |
48 |
+ xasprintf(&useflag, " %s ", root->info+invert); |
49 |
notfound = (strstr(use, useflag) == NULL ? 1 : 0); |
50 |
+ free(useflag); |
51 |
if (notfound ^ invert) { |
52 |
root->type = DEP_NULL; |
53 |
return; |