OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

206 lines
6.0 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../xz/xz-5.0.3-upstream-git-fixes-20110809.patch
  5. # Copyright (C) 2011 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. Description: Bugfixes from upstream git repository
  17. This patch includes bugfixes cherry-picked from the upstream git repository.
  18. refererence: http://git.tukaani.org/?p=xz.git
  19. From 240e8b9791df597063a3b68d04ffcb3aa4f2de6a Mon Sep 17 00:00:00 2001
  20. From: Lasse Collin <lasse.collin@tukaani.org>
  21. Date: Mon, 23 May 2011 18:30:30 +0300
  22. Subject: [PATCH] Build: Set GZIP_ENV=-9n in top-level Makefile.am.
  23. ---
  24. Makefile.am | 3 +++
  25. 1 files changed, 3 insertions(+), 0 deletions(-)
  26. diff --git a/Makefile.am b/Makefile.am
  27. index 2ce74aa..1e7ba61 100644
  28. --- a/Makefile.am
  29. +++ b/Makefile.am
  30. @@ -5,6 +5,9 @@
  31. ## You can do whatever you want with this file.
  32. ##
  33. +# Use -n to prevent gzip from adding a timestamp to the .gz headers.
  34. +GZIP_ENV = -9n
  35. +
  36. DIST_SUBDIRS = lib src po tests debug
  37. SUBDIRS =
  38. --
  39. 1.7.2.3
  40. From 844f84fcad9670c543550edf7c7e42630c8f7715 Mon Sep 17 00:00:00 2001
  41. From: Lasse Collin <lasse.collin@tukaani.org>
  42. Date: Fri, 27 May 2011 22:09:49 +0300
  43. Subject: [PATCH] liblzma: Handle allocation failures correctly in lzma_index_init().
  44. Thanks to Jim Meyering.
  45. ---
  46. src/liblzma/common/index.c | 7 +++++--
  47. 1 files changed, 5 insertions(+), 2 deletions(-)
  48. diff --git a/src/liblzma/common/index.c b/src/liblzma/common/index.c
  49. index ddb9d36..9af4bc1 100644
  50. --- a/src/liblzma/common/index.c
  51. +++ b/src/liblzma/common/index.c
  52. @@ -398,10 +398,13 @@ extern LZMA_API(lzma_index *)
  53. lzma_index_init(lzma_allocator *allocator)
  54. {
  55. lzma_index *i = index_init_plain(allocator);
  56. + if (i == NULL)
  57. + return NULL;
  58. +
  59. index_stream *s = index_stream_init(0, 0, 1, 0, allocator);
  60. - if (i == NULL || s == NULL) {
  61. - index_stream_end(s, allocator);
  62. + if (s == NULL) {
  63. lzma_free(i, allocator);
  64. + return NULL;
  65. }
  66. index_tree_append(&i->streams, &s->node);
  67. --
  68. 1.7.2.3
  69. From 6c4d4db2bc8d8b682bd927144d37daa2ab21a6d6 Mon Sep 17 00:00:00 2001
  70. From: Lasse Collin <lasse.collin@tukaani.org>
  71. Date: Fri, 27 May 2011 22:25:44 +0300
  72. Subject: [PATCH] xz: Fix error handling in xz -lvv.
  73. It could do an invalid free() and read past the end
  74. of the uninitialized filters array.
  75. ---
  76. src/xz/list.c | 21 ++++++---------------
  77. 1 files changed, 6 insertions(+), 15 deletions(-)
  78. diff --git a/src/xz/list.c b/src/xz/list.c
  79. index 1c93718..98307eb 100644
  80. --- a/src/xz/list.c
  81. +++ b/src/xz/list.c
  82. @@ -382,14 +382,9 @@ parse_block_header(file_pair *pair, const lzma_index_iter *iter,
  83. if (buf.u8[0] == 0)
  84. goto data_error;
  85. - lzma_block block;
  86. - lzma_filter filters[LZMA_FILTERS_MAX + 1];
  87. -
  88. - // Initialize the pointers so that they can be passed to free().
  89. - for (size_t i = 0; i < ARRAY_SIZE(filters); ++i)
  90. - filters[i].options = NULL;
  91. -
  92. // Initialize the block structure and decode Block Header Size.
  93. + lzma_filter filters[LZMA_FILTERS_MAX + 1];
  94. + lzma_block block;
  95. block.version = 0;
  96. block.check = iter->stream.flags->check;
  97. block.filters = filters;
  98. @@ -437,6 +432,10 @@ parse_block_header(file_pair *pair, const lzma_index_iter *iter,
  99. break;
  100. case LZMA_DATA_ERROR:
  101. + // Free the memory allocated by lzma_block_header_decode().
  102. + for (size_t i = 0; filters[i].id != LZMA_VLI_UNKNOWN; ++i)
  103. + free(filters[i].options);
  104. +
  105. goto data_error;
  106. default:
  107. @@ -466,14 +465,6 @@ data_error:
  108. // Show the error message.
  109. message_error("%s: %s", pair->src_name,
  110. message_strm(LZMA_DATA_ERROR));
  111. -
  112. - // Free the memory allocated by lzma_block_header_decode().
  113. - // This is truly needed only if we get here after a succcessful
  114. - // call to lzma_block_header_decode() but it doesn't hurt to
  115. - // always do it.
  116. - for (size_t i = 0; filters[i].id != LZMA_VLI_UNKNOWN; ++i)
  117. - free(filters[i].options);
  118. -
  119. return true;
  120. }
  121. --
  122. 1.7.2.3
  123. From 631f4d3ae6adfda84d1a110781d9402c12e16cfc Mon Sep 17 00:00:00 2001
  124. From: Lasse Collin <lasse.collin@tukaani.org>
  125. Date: Sat, 28 May 2011 16:43:26 +0300
  126. Subject: [PATCH] Don't call close(-1) in tuklib_open_stdxxx() on error.
  127. Thanks to Jim Meyering.
  128. ---
  129. src/common/tuklib_open_stdxxx.c | 4 +++-
  130. 1 files changed, 3 insertions(+), 1 deletions(-)
  131. diff --git a/src/common/tuklib_open_stdxxx.c b/src/common/tuklib_open_stdxxx.c
  132. index 08bc60d..26702a6 100644
  133. --- a/src/common/tuklib_open_stdxxx.c
  134. +++ b/src/common/tuklib_open_stdxxx.c
  135. @@ -39,12 +39,14 @@ tuklib_open_stdxxx(int err_status)
  136. | (i == 0 ? O_WRONLY : O_RDONLY));
  137. if (fd != i) {
  138. + if (fd != -1)
  139. + (void)close(fd);
  140. +
  141. // Something went wrong. Exit with the
  142. // exit status we were given. Don't try
  143. // to print an error message, since stderr
  144. // may very well be non-existent. This
  145. // error should be extremely rare.
  146. - (void)close(fd);
  147. exit(err_status);
  148. }
  149. }
  150. --
  151. 1.7.2.3
  152. From 7fcc6334ea8923550ba6b5347ff99dc8432234b0 Mon Sep 17 00:00:00 2001
  153. From: Lasse Collin <lasse.collin@tukaani.org>
  154. Date: Thu, 16 Jun 2011 12:15:29 +0300
  155. Subject: [PATCH] liblzma: Remove unneeded semicolon.
  156. ---
  157. src/liblzma/lz/lz_encoder_hash.h | 2 +-
  158. 1 files changed, 1 insertions(+), 1 deletions(-)
  159. diff --git a/src/liblzma/lz/lz_encoder_hash.h b/src/liblzma/lz/lz_encoder_hash.h
  160. index c398d7d..342a333 100644
  161. --- a/src/liblzma/lz/lz_encoder_hash.h
  162. +++ b/src/liblzma/lz/lz_encoder_hash.h
  163. @@ -39,7 +39,7 @@
  164. // Endianness doesn't matter in hash_2_calc() (no effect on the output).
  165. #ifdef TUKLIB_FAST_UNALIGNED_ACCESS
  166. # define hash_2_calc() \
  167. - const uint32_t hash_value = *(const uint16_t *)(cur);
  168. + const uint32_t hash_value = *(const uint16_t *)(cur)
  169. #else
  170. # define hash_2_calc() \
  171. const uint32_t hash_value \
  172. --
  173. 1.7.2.3