crypt: On calloc failure follow goto statement
At -------------------------------------------- 1423 if (local->vec.iov_base == NULL) { -------------------------------------------- This condition being true leads to NULL pointer to be passed into `memcpy` later at ---------------------------------------------------- 1432 memcpy((char *)local->vec.iov_base + copied, ---------------------------------------------------- Avoid this by clean exit through a goto statement with in the conditional. Change-Id: I2546b7dd634dc251adae8ca39497c4c3ef520f62 BUG: 1030058 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/6576 Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Reviewed-by: Edward Shishkin <edward.shishkin@gmail.com> Tested-by: Edward Shishkin <edward.shishkin@gmail.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
This commit is contained in:
parent
efcfb60f87
commit
d85726d194
@ -1421,8 +1421,11 @@ static int32_t prune_write(call_frame_t *frame,
|
||||
gf_crypt_mt_data);
|
||||
|
||||
if (local->vec.iov_base == NULL) {
|
||||
gf_log(this->name, GF_LOG_WARNING,
|
||||
"Failed to calloc head block for prune");
|
||||
local->op_ret = -1;
|
||||
local->op_errno = ENOMEM;
|
||||
goto put_one_call;
|
||||
}
|
||||
for (i = 0; i < count; i++) {
|
||||
to_copy = vec[i].iov_len;
|
||||
|
Loading…
x
Reference in New Issue
Block a user