Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-1.9.git;a=commitdiff;h=5aecdc1a05337f4353fbe2d9c9a96fca47d1e727
commit 5aecdc1a05337f4353fbe2d9c9a96fca47d1e727 Author: kikadf <[email protected]> Date: Thu Feb 6 09:54:19 2014 +0100 libyaml-0.1.4-3arcturus1-x86_64 * Fix CVE-2013-6393 diff --git a/source/lib-extra/libyaml/CVE-2013-6393.patch b/source/lib-extra/libyaml/CVE-2013-6393.patch new file mode 100644 index 0000000..2fcf837 --- /dev/null +++ b/source/lib-extra/libyaml/CVE-2013-6393.patch @@ -0,0 +1,158 @@ +diff -Naur yaml-0.1.4/src/api.c yaml-0.1.4.new/src/api.c +--- yaml-0.1.4/src/api.c 2011-05-29 08:55:42.000000000 +0200 ++++ yaml-0.1.4.new/src/api.c 2014-02-02 02:06:09.257821100 +0100 +@@ -117,7 +117,12 @@ + YAML_DECLARE(int) + yaml_stack_extend(void **start, void **top, void **end) + { +- void *new_start = yaml_realloc(*start, ((char *)*end - (char *)*start)*2); ++ void *new_start; ++ ++ if ((char *)*end - (char *)*start >= INT_MAX / 2) ++ return 0; ++ ++ new_start = yaml_realloc(*start, ((char *)*end - (char *)*start)*2); + + if (!new_start) return 0; + +diff -Naur yaml-0.1.4/src/scanner.c yaml-0.1.4.new/src/scanner.c +--- yaml-0.1.4/src/scanner.c 2011-05-29 08:55:42.000000000 +0200 ++++ yaml-0.1.4.new/src/scanner.c 2014-02-02 02:06:23.752650200 +0100 +@@ -615,11 +615,14 @@ + */ + + static int +-yaml_parser_roll_indent(yaml_parser_t *parser, int column, ++yaml_parser_roll_indent(yaml_parser_t *parser, size_t column, + int number, yaml_token_type_t type, yaml_mark_t mark); + + static int +-yaml_parser_unroll_indent(yaml_parser_t *parser, int column); ++yaml_parser_unroll_indent(yaml_parser_t *parser, size_t column); ++ ++static int ++yaml_parser_reset_indent(yaml_parser_t *parser); + + /* + * Token fetchers. +@@ -1206,7 +1209,7 @@ + */ + + static int +-yaml_parser_roll_indent(yaml_parser_t *parser, int column, ++yaml_parser_roll_indent(yaml_parser_t *parser, size_t column, + int number, yaml_token_type_t type, yaml_mark_t mark) + { + yaml_token_t token; +@@ -1216,7 +1219,7 @@ + if (parser->flow_level) + return 1; + +- if (parser->indent < column) ++ if (parser->indent == -1 || parser->indent < column) + { + /* + * Push the current indentation level to the stack and set the new +@@ -1254,7 +1257,7 @@ + + + static int +-yaml_parser_unroll_indent(yaml_parser_t *parser, int column) ++yaml_parser_unroll_indent(yaml_parser_t *parser, size_t column) + { + yaml_token_t token; + +@@ -1263,6 +1266,15 @@ + if (parser->flow_level) + return 1; + ++ /* ++ * column is unsigned and parser->indent is signed, so if ++ * parser->indent is less than zero the conditional in the while ++ * loop below is incorrect. Guard against that. ++ */ ++ ++ if (parser->indent < 0) ++ return 1; ++ + /* Loop through the intendation levels in the stack. */ + + while (parser->indent > column) +@@ -1283,6 +1295,41 @@ + } + + /* ++ * Pop indentation levels from the indents stack until the current ++ * level resets to -1. For each intendation level, append the ++ * BLOCK-END token. ++ */ ++ ++static int ++yaml_parser_reset_indent(yaml_parser_t *parser) ++{ ++ yaml_token_t token; ++ ++ /* In the flow context, do nothing. */ ++ ++ if (parser->flow_level) ++ return 1; ++ ++ /* Loop through the intendation levels in the stack. */ ++ ++ while (parser->indent > -1) ++ { ++ /* Create a token and append it to the queue. */ ++ ++ TOKEN_INIT(token, YAML_BLOCK_END_TOKEN, parser->mark, parser->mark); ++ ++ if (!ENQUEUE(parser, parser->tokens, token)) ++ return 0; ++ ++ /* Pop the indentation level. */ ++ ++ parser->indent = POP(parser, parser->indents); ++ } ++ ++ return 1; ++} ++ ++/* + * Initialize the scanner and produce the STREAM-START token. + */ + +@@ -1338,7 +1385,7 @@ + + /* Reset the indentation level. */ + +- if (!yaml_parser_unroll_indent(parser, -1)) ++ if (!yaml_parser_reset_indent(parser)) + return 0; + + /* Reset simple keys. */ +@@ -1369,7 +1416,7 @@ + + /* Reset the indentation level. */ + +- if (!yaml_parser_unroll_indent(parser, -1)) ++ if (!yaml_parser_reset_indent(parser)) + return 0; + + /* Reset simple keys. */ +@@ -1407,7 +1454,7 @@ + + /* Reset the indentation level. */ + +- if (!yaml_parser_unroll_indent(parser, -1)) ++ if (!yaml_parser_reset_indent(parser)) + return 0; + + /* Reset simple keys. */ +@@ -2574,7 +2621,7 @@ + + /* Resize the string to include the head. */ + +- while (string.end - string.start <= (int)length) { ++ while ((size_t)(string.end - string.start) <= length) { + if (!yaml_string_extend(&string.start, &string.pointer, &string.end)) { + parser->error = YAML_MEMORY_ERROR; + goto error; diff --git a/source/lib-extra/libyaml/FrugalBuild b/source/lib-extra/libyaml/FrugalBuild index 1ea5f7c..fa77628 100644 --- a/source/lib-extra/libyaml/FrugalBuild +++ b/source/lib-extra/libyaml/FrugalBuild @@ -1,10 +1,12 @@ # Compiling Time: 0.17 SBU # Maintainer: Slown <[email protected]> +options+=('asneeded') + pkgname=libyaml _F_archive_name="yaml" pkgver=0.1.4 -pkgrel=2 +pkgrel=3arcturus1 pkgdesc="LibYAML is a YAML 1.1 parser and emitter written in C." url="http://pyyaml.org/wiki/LibYAML" depends=('glibc') @@ -15,4 +17,10 @@ source=(http://pyyaml.org/download/$pkgname/$_F_archive_name-$pkgver.tar.gz) _F_cd_path="yaml-$pkgver" sha1sums=('e0e5e09192ab10a607e3da2970db492118f560f2') +# FSA fix *** +source=(${source[@]} CVE-2013-6393.patch) +sha1sums=(${sha1sums[@]} '353c869c1e9a691dfac5a1e0daa4201e5dfee7c8') +# *********** + + # optimization OK _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
