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.

30 lines
950 B

  1. From b92902814f796bb1dc24bab2179000caceb5b151 Mon Sep 17 00:00:00 2001
  2. From: Thierry FOURNIER <tfournier@exceliance.fr>
  3. Date: Tue, 10 Mar 2015 01:55:01 +0100
  4. Subject: [PATCH 5/9] BUG/MEDIUM: buffer: one byte miss in buffer free space
  5. check
  6. Space is not avalaible only if the end of the data inserted
  7. is strictly greater than the end of buffer. If these two value
  8. are equal, the space is avamaible.
  9. (cherry picked from commit fdda6777bffb4f933569c609ba54e24ea5eabf29)
  10. ---
  11. src/buffer.c | 2 +-
  12. 1 file changed, 1 insertion(+), 1 deletion(-)
  13. diff --git a/src/buffer.c b/src/buffer.c
  14. index 9037dd3..8d2644e 100644
  15. --- a/src/buffer.c
  16. +++ b/src/buffer.c
  17. @@ -46,7 +46,7 @@ int buffer_replace2(struct buffer *b, char *pos, char *end, const char *str, int
  18. delta = len - (end - pos);
  19. - if (bi_end(b) + delta >= b->data + b->size)
  20. + if (bi_end(b) + delta > b->data + b->size)
  21. return 0; /* no space left */
  22. if (buffer_not_empty(b) &&
  23. --
  24. 2.0.5