Skip to content

Commit

Permalink
Fix regression problems with weird-files tests
Browse files Browse the repository at this point in the history
Fixes #362: regression tests using the "weird files" are failing on
solaris and Ubuntu 12.4 and 14.4
  • Loading branch information
pstorz authored and Marco van Wieringen committed Feb 17, 2015
1 parent 0af525c commit f432658
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dird/catreq.c
Expand Up @@ -659,7 +659,10 @@ bool despool_attributes_from_file(JCR *jcr, const char *file)
size += sizeof(int32_t);
msglen = ntohl(pktsiz);
if (msglen > 0) {
if (msglen > (int32_t) sizeof_pool_memory(msg)) {
/*
* check for msglen + \0
*/
if ((msglen + 1) > (int32_t) sizeof_pool_memory(msg)) {
msg = realloc_pool_memory(msg, msglen + 1);
}
nbytes = fread(msg, 1, msglen, spool_fd);
Expand Down

0 comments on commit f432658

Please sign in to comment.