Skip to content
Permalink
Browse files

Bug#4193 - Out of bounds read in tests/api/str.c.

  • Loading branch information...
tjsaunders
tjsaunders committed Jul 25, 2015
1 parent db98dc1 commit d9f9d469ce1da09c7935f509797d488fa2d08697
Showing with 2 additions and 1 deletion.
  1. +2 −1 tests/api/str.c
@@ -228,10 +228,11 @@ START_TEST (sreplace_enospc_test) {
char *fmt = NULL, *res;
size_t bufsz = 8192;

fmt = palloc(p, bufsz);
fmt = palloc(p, bufsz + 1);
memset(fmt, ' ', bufsz);
fmt[bufsz-2] = '%';
fmt[bufsz-1] = 'a';
fmt[bufsz] = '\0';

res = sreplace(p, fmt, "%a", "foo", NULL);
fail_unless(res == NULL, "Failed to reject too-long buffer");

0 comments on commit d9f9d46

Please sign in to comment.
You can’t perform that action at this time.