[LU-10728] lnet/utils/lnetconfig/liblnetconfig.c uses sizeof on pointers Created: 27/Feb/18 Updated: 03/Nov/20 Resolved: 03/Nov/20 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.14.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | John Hammond | Assignee: | Cyril Bordage |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Severity: | 3 |
| Rank (Obsolete): | 9223372036854775807 |
| Description |
static int lustre_lnet_resolve_ip2nets_rule(struct lustre_lnet_ip2nets *ip2nets, lnet_nid_t **nids, __u32 *nnids, char *err_str, size_t str_len) { ... rc = lustre_lnet_intf2nids(&ip2nets->ip2nets_net, nids, nnids, err_str, sizeof(err_str)); ... } |
| Comments |
| Comment by John Hammond [ 27/Feb/18 ] |
|
There are also several places where we do char err_str[LNET_MAX_STR_LEN]; snprintf(err_str, sizeof(err_str), "\"success\""); instead of just char err_str[LNET_MAX_STR_LEN] = "\"success\""; and where we explicitly '\0' terminate a buffer after calling snprintf(): snprintf(err_str, str_len, "\"failed to get interface addresses: %d\"", -errno); err_str[str_len - 1] = '\0'; |
| Comment by John Hammond [ 15/Oct/20 ] |
|
cbordage, could you take a look? |
| Comment by Gerrit Updater [ 16/Oct/20 ] |
|
Cyril Bordage (cbordage@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/40268 |
| Comment by Gerrit Updater [ 03/Nov/20 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/40268/ |
| Comment by Peter Jones [ 03/Nov/20 ] |
|
Landed for 2.14 |