cherry-pick.FILE5_31-36-g35c94dc6.Fix-always-true-condition-Thomas-Jarosch.patch 897 B

1234567891011121314151617181920212223242526
  1. From: Christos Zoulas <christos@zoulas.com>
  2. Date: Sun, 27 Aug 2017 07:55:02 +0000
  3. Subject: Fix always true condition (Thomas Jarosch)
  4. Origin: https://github.com/file/file/commit/35c94dc6acc418f1ad7f6241a6680e5327495793
  5. Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-1000249
  6. ---
  7. src/readelf.c | 4 ++--
  8. 1 file changed, 2 insertions(+), 2 deletions(-)
  9. diff --git a/src/readelf.c b/src/readelf.c
  10. index 81451827..5f425c97 100644
  11. --- a/src/readelf.c
  12. +++ b/src/readelf.c
  13. @@ -511,7 +511,7 @@ do_bid_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
  14. size_t noff, size_t doff, int *flags)
  15. {
  16. if (namesz == 4 && strcmp((char *)&nbuf[noff], "GNU") == 0 &&
  17. - type == NT_GNU_BUILD_ID && (descsz >= 4 || descsz <= 20)) {
  18. + type == NT_GNU_BUILD_ID && (descsz >= 4 && descsz <= 20)) {
  19. uint8_t desc[20];
  20. const char *btype;
  21. uint32_t i;
  22. --
  23. 2.14.1