Skip to content

Commit

Permalink
UCT/IB: Fix buffer overflow with strncat().
Browse files Browse the repository at this point in the history
  • Loading branch information
yosefe committed Jun 29, 2017
1 parent 71dfa34 commit 7fd9e4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/uct/ib/base/ib_md.c
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ static ucs_rcache_ops_t uct_ib_rcache_ops = {
static void uct_ib_make_md_name(char md_name[UCT_MD_NAME_MAX], struct ibv_device *device)
{
snprintf(md_name, UCT_MD_NAME_MAX, "%s/", UCT_IB_MD_PREFIX);
strncat(md_name, device->name, UCT_MD_NAME_MAX);
strncat(md_name, device->name, UCT_MD_NAME_MAX - strlen(device->name) - 1);
}

static ucs_status_t uct_ib_query_md_resources(uct_md_resource_desc_t **resources_p,
Expand Down

0 comments on commit 7fd9e4d

Please sign in to comment.