]> git.pld-linux.org Git - packages/ctags.git/blob - ctags-CVE-2014-7204.patch
- rel 5; add fixes and improvements from FC
[packages/ctags.git] / ctags-CVE-2014-7204.patch
1 --- ctags/jscript.c.orig        2008-10-13 00:27:38.000000000 +0200
2 +++ ctags/jscript.c     2014-09-30 13:49:34.837349283 +0200
3 @@ -1,5 +1,5 @@
4  /*
5 - *      $Id: jscript.c 666 2008-05-15 17:47:31Z dfishburn $
6 + *      $Id: jscript.c 791 2012-10-24 01:13:13Z dfishburn $
7   *
8   *      Copyright (c) 2003, Darren Hiebert
9   *
10 @@ -215,6 +215,7 @@
11   *      Tag generation functions
12   */
13  
14 +/*
15  static void makeConstTag (tokenInfo *const token, const jsKind kind)
16  {
17         if (JsKinds [kind].enabled && ! token->ignoreTag )
18 @@ -238,12 +239,13 @@
19  
20         if (JsKinds [kind].enabled && ! token->ignoreTag )
21         {
22 -               /*
23 +               *
24                  * If a scope has been added to the token, change the token
25                  * string to include the scope when making the tag.
26 -                */
27 +                *
28                 if ( vStringLength(token->scope) > 0 )
29                 {
30 +                       *
31                         fulltag = vStringNew ();
32                         vStringCopy(fulltag, token->scope);
33                         vStringCatS (fulltag, ".");
34 @@ -251,8 +253,54 @@
35                         vStringTerminate(fulltag);
36                         vStringCopy(token->string, fulltag);
37                         vStringDelete (fulltag);
38 +                       *
39 +                       jsKind parent_kind = JSTAG_CLASS;
40
41 +                       * 
42 +                        * if we're creating a function (and not a method),
43 +                        * guess we're inside another function 
44 +                        *
45 +                       if (kind == JSTAG_FUNCTION)
46 +                               parent_kind = JSTAG_FUNCTION;
47
48 +                       e.extensionFields.scope[0] = JsKinds [parent_kind].name;
49 +                       e.extensionFields.scope[1] = vStringValue (token->scope);
50                 }
51 -               makeConstTag (token, kind);
52 +               * makeConstTag (token, kind); *
53 +               makeTagEntry (&e);
54 +       }
55 +}
56 +*/
57 +
58 +static void makeJsTag (tokenInfo *const token, const jsKind kind)
59 +{
60 +       if (JsKinds [kind].enabled && ! token->ignoreTag )
61 +       {
62 +               const char *const name = vStringValue (token->string);
63 +               tagEntryInfo e;
64 +               initTagEntry (&e, name);
65 +
66 +               e.lineNumber   = token->lineNumber;
67 +               e.filePosition = token->filePosition;
68 +               e.kindName         = JsKinds [kind].name;
69 +               e.kind             = JsKinds [kind].letter;
70 +
71 +               if ( vStringLength(token->scope) > 0 )
72 +               {
73 +                       jsKind parent_kind = JSTAG_CLASS;
74 +
75 +                       /* 
76 +                        * If we're creating a function (and not a method),
77 +                        * guess we're inside another function 
78 +                        */
79 +                       if (kind == JSTAG_FUNCTION)
80 +                               parent_kind = JSTAG_FUNCTION;
81 +
82 +                       e.extensionFields.scope[0] = JsKinds [parent_kind].name;
83 +                       e.extensionFields.scope[1] = vStringValue (token->scope);
84 +               }
85 +
86 +               makeTagEntry (&e);
87         }
88  }
89  
This page took 0.055264 seconds and 3 git commands to generate.