diff options
author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2017-04-21 19:27:33 +0000 |
---|---|---|
committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2017-04-21 19:27:33 +0000 |
commit | efa8af7c73372cd2dc2cca734c2713592fd0d6bd (patch) | |
tree | 95b96b0ac6ded34ff5298c39db0a2c518884c3ca /lib/libgssapi | |
parent | 6284ff839866511366571b2529897756273a6398 (diff) | |
download | src-efa8af7c73372cd2dc2cca734c2713592fd0d6bd.tar.gz src-efa8af7c73372cd2dc2cca734c2713592fd0d6bd.zip |
lib: initial use of reallocarray(3).
Make some use of reallocarray, attempting to limit it to cases where the
parameters are unsigned and there is some theoretical chance of overflow.
MFC afer: 2 weeks
Differential Revision: https://reviews.freebsd.org/D9980
Notes
Notes:
svn path=/head/; revision=317265
Diffstat (limited to 'lib/libgssapi')
-rw-r--r-- | lib/libgssapi/gss_buffer_set.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libgssapi/gss_buffer_set.c b/lib/libgssapi/gss_buffer_set.c index af62e5c29596..100dd4d58d4d 100644 --- a/lib/libgssapi/gss_buffer_set.c +++ b/lib/libgssapi/gss_buffer_set.c @@ -76,8 +76,8 @@ gss_add_buffer_set_member(OM_uint32 * minor_status, } set = *buffer_set; - set->elements = realloc(set->elements, - (set->count + 1) * sizeof(set->elements[0])); + set->elements = reallocarray(set->elements, set->count + 1, + sizeof(set->elements[0])); if (set->elements == NULL) { *minor_status = ENOMEM; return (GSS_S_FAILURE); |