diff options
author | Roland Dreier <rolandd@cisco.com> | 2005-10-23 22:32:47 +0000 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-11-09 11:35:58 -0800 |
commit | 99ffd10ad27caaba5995b9b667b53982c3502418 (patch) | |
tree | 62ff495d8bbfee858be91c09b5a583dc046bd109 | |
parent | 16dbfc8e2b0b3ed5f94652587c79cd7083da033f (diff) | |
download | libibverbs-99ffd10ad27caaba5995b9b667b53982c3502418.tar.gz |
Fix buffer size computation in ibv_cmd_get_context_v2()
Correct silly mistake in ibv_cmd_get_context_v2() computation of size
of buffer for old ABI command: we need to use sizeof *cmd instead of
sizeof cmd, since cmd is a pointer.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/cmd.c | 2 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,9 @@ +2005-10-23 Roland Dreier <roland@cisco.com> + + * src/cmd.c (ibv_cmd_get_context_v2): Correct silly mistake in + computation of size of buffer for old ABI command: we need to use + sizeof *cmd instead of sizeof cmd, since cmd is a pointer. + 2005-10-21 Roland Dreier <roland@cisco.com> * src/cmd.c (ibv_cmd_post_send, ibv_cmd_post_recv, @@ -60,7 +60,7 @@ static int ibv_cmd_get_context_v2(struct ibv_context *context, return ENOMEM; pthread_mutex_init(&t->in_use, NULL); - cmd_size = sizeof cmd + new_cmd_size - sizeof *new_cmd; + cmd_size = sizeof *cmd + new_cmd_size - sizeof *new_cmd; cmd = alloca(cmd_size); memcpy(cmd->driver_data, new_cmd->driver_data, new_cmd_size - sizeof *new_cmd); |