Gentoo Archives: gentoo-commits

From: "Alexis Ballier (aballier)" <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-text/texlive-core/files/2007: texlive-core-2007-dvips_bufferoverflow.patch
Date: Mon, 22 Oct 2007 06:33:31
Message-Id: E1IjqgH-0005Iz-5v@stork.gentoo.org
1 aballier 07/10/22 06:22:29
2
3 Added: texlive-core-2007-dvips_bufferoverflow.patch
4 Log:
5 Add a patch from upstream to prevent buffer overflow with too long hrefs using dvips -z
6 (Portage version: 2.1.3.15)
7
8 Revision Changes Path
9 1.1 app-text/texlive-core/files/2007/texlive-core-2007-dvips_bufferoverflow.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-text/texlive-core/files/2007/texlive-core-2007-dvips_bufferoverflow.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-text/texlive-core/files/2007/texlive-core-2007-dvips_bufferoverflow.patch?rev=1.1&content-type=text/plain
13
14 Index: texlive-core-2007-dvips_bufferoverflow.patch
15 ===================================================================
16 hps.c (stamp_external, stamp_hps): protext against long strings.
17 From Bastien Roucaries via Norbert, 21 Oct 2007 13:22:19,
18 Debian bug 447081.
19
20 Index: texk/dvipsk/hps.c
21 ===================================================================
22 --- texk/dvipsk/hps.c (revision 5253)
23 +++ texk/dvipsk/hps.c (revision 5254)
24 @@ -441,20 +441,29 @@
25
26 void stamp_hps P1C(Hps_link *, pl)
27 {
28 - char tmpbuf[200] ;
29 + char * tmpbuf;
30 if (pl == NULL) {
31 - error("Null pointer, oh no!") ;
32 + error("stamp_hps: null pl pointer, oh no!") ;
33 return ;
34 - } else {
35 - /* print out the proper pdfm with local page info only
36 - * target info will be in the target dictionary */
37 - (void)sprintf(tmpbuf,
38 - " (%s) [[%.0f %.0f %.0f %.0f] [%i %i %i [%i %i]] [%.0f %.0f %.0f]] pdfm ", pl->title, pl->rect.llx, pl->rect.lly, pl->rect.urx, pl->rect.ury,
39 - pl->border[0], pl->border[1], pl->border[2], pl->border[3],pl->border[4],
40 - pl->color[0], pl->color[1], pl->color[2]) ;
41 - cmdout(tmpbuf) ;
42 - }
43 + }
44 + if(pl->title == NULL) {
45 + error("stamp_hps: null pl->title pointer, oh no!") ;
46 + return ;
47 + }
48 +
49 + tmpbuf = (char *) xmalloc(strlen(pl->title)+200);
50 +
51 + /* print out the proper pdfm with local page info only
52 + * target info will be in the target dictionary */
53 + (void)sprintf(tmpbuf,
54 + " (%s) [[%.0f %.0f %.0f %.0f] [%i %i %i [%i %i]] [%.0f %.0f %.0f]] pdfm ",
55 + pl->title, pl->rect.llx, pl->rect.lly, pl->rect.urx, pl->rect.ury,
56 + pl->border[0], pl->border[1], pl->border[2], pl->border[3],pl->border[4],
57 + pl->color[0], pl->color[1], pl->color[2]) ;
58 + cmdout(tmpbuf) ;
59 + free(tmpbuf);
60
61 +
62 }
63
64 /* For external URL's, we just pass them through as a string. The hyperps
65 @@ -462,18 +471,27 @@
66 */
67 void stamp_external P2C(char *, s, Hps_link *, pl)
68 {
69 - char tmpbuf[200];
70 + char *tmpbuf;
71 if (pl == NULL) {
72 - error("Null pointer, oh no!") ;
73 + error("stamp_external: null pl pointer, oh no!") ;
74 return ;
75 - } else {
76 - /* print out the proper pdfm with local page info only
77 - * target info will be in the target dictionary */
78 - (void)sprintf(tmpbuf," [[%.0f %.0f %.0f %.0f] [%i %i %i [%i %i]] [%.0f %.0f %.0f]] (%s) pdfm ", pl->rect.llx, pl->rect.lly, pl->rect.urx, pl->rect.ury,
79 - pl->border[0], pl->border[1], pl->border[2], pl->border[3],pl->border[4],
80 - pl->color[0], pl->color[1], pl->color[2], s) ;
81 - cmdout(tmpbuf) ;
82 - }
83 + }
84 +
85 + if (s == NULL) {
86 + error("stamp_external: null s pointer, oh no!") ;
87 + return ;
88 + }
89 +
90 + tmpbuf = (char *) xmalloc(strlen(s) + 200);
91 +
92 + /* print out the proper pdfm with local page info only
93 + * target info will be in the target dictionary */
94 + (void)sprintf(tmpbuf," [[%.0f %.0f %.0f %.0f] [%i %i %i [%i %i]] [%.0f %.0f %.0f]] (%s) pdfm ",
95 + pl->rect.llx, pl->rect.lly, pl->rect.urx, pl->rect.ury,
96 + pl->border[0], pl->border[1], pl->border[2], pl->border[3],pl->border[4],
97 + pl->color[0], pl->color[1], pl->color[2], s) ;
98 + cmdout(tmpbuf) ;
99 + free(tmpbuf);
100 }
101
102 void finish_hps P1H(void) {
103
104
105
106 --
107 gentoo-commits@g.o mailing list