Sun Mar 29 09:19:06 2015 UTC ()
SECURITY: Fix CVE-2014-7204 (DoS in JavaScript parser) in exuberant-ctags.
(bsiegert)
diff -r1.26 -r1.27 pkgsrc/devel/exctags/Makefile
diff -r1.12 -r1.13 pkgsrc/devel/exctags/distinfo
diff -r0 -r1.1 pkgsrc/devel/exctags/patches/patch-CVE-2014-7204
--- pkgsrc/devel/exctags/Makefile 2014/10/09 14:06:08 1.26
+++ pkgsrc/devel/exctags/Makefile 2015/03/29 09:19:06 1.27
--- pkgsrc/devel/exctags/distinfo 2013/05/05 21:56:22 1.12
+++ pkgsrc/devel/exctags/distinfo 2015/03/29 09:19:06 1.13
$NetBSD: patch-CVE-2014-7204,v 1.1 2015/03/29 09:19:06 bsiegert Exp $
http://sourceforge.net/p/ctags/code/791/
Fix denial of service that results from attempting to run ctags
over large volumes of public source code.
--- jscript.c
+++ jscript.c
@@ -215,6 +215,7 @@
* Tag generation functions
*/
+/*
static void makeConstTag (tokenInfo *const token, const jsKind kind)
{
if (JsKinds [kind].enabled && ! token->ignoreTag )
@@ -238,12 +239,13 @@
if (JsKinds [kind].enabled && ! token->ignoreTag )
{
- /*
+ *
* If a scope has been added to the token, change the token
* string to include the scope when making the tag.
- */
+ *
if ( vStringLength(token->scope) > 0 )
{
+ *
fulltag = vStringNew ();
vStringCopy(fulltag, token->scope);
vStringCatS (fulltag, ".");
@@ -251,8 +253,54 @@
vStringTerminate(fulltag);
vStringCopy(token->string, fulltag);
vStringDelete (fulltag);
- }
- makeConstTag (token, kind);
+ *
+ jsKind parent_kind = JSTAG_CLASS;
+
+ *
+ * if we're creating a function (and not a method),
+ * guess we're inside another function
+ *
+ if (kind == JSTAG_FUNCTION)
+ parent_kind = JSTAG_FUNCTION;
+
+ e.extensionFields.scope[0] = JsKinds [parent_kind].name;
+ e.extensionFields.scope[1] = vStringValue (token->scope);
+ }
+ * makeConstTag (token, kind); *
+ makeTagEntry (&e);
+ }
+}
+*/
+
+static void makeJsTag (tokenInfo *const token, const jsKind kind)
+{
+ if (JsKinds [kind].enabled && ! token->ignoreTag )
+ {
+ const char *const name = vStringValue (token->string);
+ tagEntryInfo e;
+ initTagEntry (&e, name);
+
+ e.lineNumber = token->lineNumber;
+ e.filePosition = token->filePosition;
+ e.kindName = JsKinds [kind].name;
+ e.kind = JsKinds [kind].letter;
+
+ if ( vStringLength(token->scope) > 0 )
+ {
+ jsKind parent_kind = JSTAG_CLASS;
+
+ /*
+ * If we're creating a function (and not a method),
+ * guess we're inside another function
+ */
+ if (kind == JSTAG_FUNCTION)
+ parent_kind = JSTAG_FUNCTION;
+
+ e.extensionFields.scope[0] = JsKinds [parent_kind].name;
+ e.extensionFields.scope[1] = vStringValue (token->scope);
+ }
+
+ makeTagEntry (&e);
}
}