Since the option '--format' for specifying the rbd image format is
deprecated, we should recommend '--image-format' instead.
Signed-off-by: Sébastien Han <sebastien.han@enovance.com>
Make sure k and m paramter are valid to prevent crash. Fix typo.
Fix for the following CID and other possible invalid combinations
of k/m parameter:
CID 1219466 (#1 of 1): Division or modulo by zero (DIVIDE_BY_ZERO)
divide_by_zero: In expression rand() % (k + m), modulo by expression
k + m which may be zero has undefined behavior.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fixes: #7796
Backport: giany, firefly
Need to set content length to this request, as the server might not
handle a chunked request (even though we don't send anything).
Tested-by: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
The MClientCaps* is allowed to be NULL, so we can't deref it unless
the dirty param is non-zero. So don't do the ahead-of-time lookup;
just call it explicitly in the if block.
Signed-off-by: Greg Farnum <greg@inktank.com>
Many integers were parsed with functions that silently ignored junk at
the end of the string. Extra characters now cause errors.
Fixes: 8983
Signed-off-by: Adam Crume <adamcrume@gmail.com>
These values can be printed by MClientRequest message output, but if
they're flushed out via cap updates we don't even get that. These
are important values that generally don't change often; so print
them out in debug logging.
Signed-off-by: Greg Farnum <greg@inktank.com>
Refactor code to use calloc() instead of malloc() to make
sure the char* TEST_BUCKET_OBJECT_SIZE memory is set to
zero before call put_bucket_obj().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix for:
CID 1054876 (#1 of 1): Use after free (USE_AFTER_FREE)
pass_freed_arg: Passing freed pointer bucket_obj as an
argument to put_bucket_obj
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Release completion as soon as no longer needed.
Fix for:
CID 1219593 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable completion going out of scope
leaks the storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix for another case of:
CID 717112 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable io_ctx going out of scope leaks
the storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
In case of strncpy() make sure string is '\0' terminated. Before
usage of strcat() check if the destination has enough free space
to concat the char and to terminate the string to prevent illegal
memory access.
Fix for:
CID 1219459 (2 of 2): Buffer not null terminated (BUFFER_SIZE_WARNING)
buffer_size_warning: Calling strncpy with a maximum size argument of
1024 bytes on destination array goodfile of size 1024 bytes might
leave the destination string unterminated.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Reserve last char in array for '\0' to ensure termination
of the string.
Fix for:
CID 1128383 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)
buffer_size_warning: Calling strncpy with a maximum size argument
of 1000 bytes on destination array secret of size 1000 bytes might
leave the destination string unterminated.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>