mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 10:41:26 +00:00
Merged revisions 5602 via svnmerge from
svn+ssh://vlnb@svn.code.sf.net/p/scst/svn/trunk ........ r5602 | vlnb | 2014-06-13 16:57:26 -0700 (Fri, 13 Jun 2014) | 8 lines scst_pr_read_reservation(): Initialize returned buffer Avoid that this function returns an uninitialized buffer to the initiator if buffer_size < 8. Detected by Coverity. Signed-off-by: Bart Van Assche <bvanassche@acm.org> ........ git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5604 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -2566,7 +2566,7 @@ void scst_pr_read_reservation(struct scst_cmd *cmd, uint8_t *buffer,
|
||||
int buffer_size)
|
||||
{
|
||||
struct scst_device *dev = cmd->dev;
|
||||
uint8_t b[24];
|
||||
uint8_t b[24] = { };
|
||||
int size = 0;
|
||||
|
||||
TRACE_ENTRY();
|
||||
@@ -2579,8 +2579,6 @@ void scst_pr_read_reservation(struct scst_cmd *cmd, uint8_t *buffer,
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset(b, 0, sizeof(b));
|
||||
|
||||
put_unaligned_be32(dev->pr_generation, &b[0]);
|
||||
|
||||
if (!dev->pr_is_set) {
|
||||
|
||||
Reference in New Issue
Block a user