Skip to content
Browse files

Fixes EUCA-3962 where a string buffer may not endup being null

terminated. Fixes Coverity issue #11099.
  • Loading branch information...
1 parent 017002b commit e788d9eeee4dacfe6206f0a67f6e0a4401108836 @gelinasc gelinasc committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 storage/blobstore.c
View
4 storage/blobstore.c
@@ -726,8 +726,8 @@ static int buf_to_fd (int fd, const char * buf, int size_buf)
static int read_store_metadata (blobstore * bs)
{
- char buf [1024];
- int size = fd_to_buf (bs->fd, buf, sizeof (buf));
+ char buf [1024] = { 0 };
+ int size = fd_to_buf (bs->fd, buf, (sizeof (buf) - 1));
if (size == -1)
return -1;

0 comments on commit e788d9e

Please sign in to comment.
Something went wrong with that request. Please try again.