diff options
author | Yaniv Kaul <ykaul@redhat.com> | 2018-08-21 19:25:11 +0300 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-08-31 06:16:12 +0000 |
commit | a1d61242baed1c2078707c401632719e756fcacb (patch) | |
tree | 7d121bbd7ee51db8fca493e94a9b9a4d4521b377 /xlators/nfs/server/src/mount3.c | |
parent | 7772315bd7d82d5f06f008dfe767f1e597a41b23 (diff) |
changetimerecoder xlator: strncpy()->sprintf(), reduce strlen()'s
xlators/features/changetimerecorder/src/changetimerecorder.c
xlators/features/changetimerecorder/src/ctr-helper.h
strncpy may not be very efficient for short strings copied into
a large buffer: If the length of src is less than n,
strncpy() writes additional null bytes to dest to ensure
that a total of n bytes are written.
Instead, use snprintf(). Check for output truncation
where applicable.
Also:
- save the result of strlen() and re-use it when possible.
- move from strlen to SLEN (sizeof() ) for const strings.
Compile-tested only!
Change-Id: I2dd5629183222da8c9251af43b8b29aacf12a20a
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'xlators/nfs/server/src/mount3.c')
0 files changed, 0 insertions, 0 deletions