0001-buffer-Fix-size-comparison-with-count.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From 2aa8c46a853acd4198af16e417ebffd5b0e2c9f4 Mon Sep 17 00:00:00 2001
  2. From: Andreas Schneider <asn@cryptomilk.org>
  3. Date: Mon, 1 Oct 2018 20:58:47 +0200
  4. Subject: [PATCH] buffer: Fix size comparison with count
  5. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
  6. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
  7. ---
  8. Upstream status: commit 9c3ba94960cd5
  9. src/buffer.c | 6 +++---
  10. 1 file changed, 3 insertions(+), 3 deletions(-)
  11. diff --git a/src/buffer.c b/src/buffer.c
  12. index da6e587fc9e4..b029f202660f 100644
  13. --- a/src/buffer.c
  14. +++ b/src/buffer.c
  15. @@ -816,8 +816,8 @@ static int ssh_buffer_pack_allocate_va(struct ssh_buffer_struct *buffer,
  16. ssh_string string = NULL;
  17. char *cstring = NULL;
  18. size_t needed_size = 0;
  19. - size_t count;
  20. size_t len;
  21. + int count; /* int for size comparison with argc */
  22. int rc = SSH_OK;
  23. for (p = format, count = 0; *p != '\0'; p++, count++) {
  24. @@ -934,7 +934,7 @@ int ssh_buffer_pack_va(struct ssh_buffer_struct *buffer,
  25. char *cstring;
  26. bignum b;
  27. size_t len;
  28. - int count;
  29. + int count; /* int for size comparison with argc */
  30. for (p = format, count = 0; *p != '\0'; p++, count++) {
  31. /* Invalid number of arguments passed */
  32. @@ -1098,7 +1098,7 @@ int ssh_buffer_unpack_va(struct ssh_buffer_struct *buffer,
  33. } o;
  34. size_t len, rlen, max_len;
  35. va_list ap_copy;
  36. - int count;
  37. + int count; /* int for size comparison with argc */
  38. max_len = ssh_buffer_get_len(buffer);
  39. --
  40. 2.20.1