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 | 1234cbbb41b6bf57c7094a5e9d015db7b303c44c (patch) | |
tree | 5d0f4dbfb4599374995f8bdcdefacb43043ee1f7 /libutil/login_cap.c | |
parent | 841aacdd6b25fd8a7324623dbc2ebae7e572a6f6 (diff) | |
download | pw-darwin-1234cbbb41b6bf57c7094a5e9d015db7b303c44c.tar.gz pw-darwin-1234cbbb41b6bf57c7094a5e9d015db7b303c44c.tar.zst pw-darwin-1234cbbb41b6bf57c7094a5e9d015db7b303c44c.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
Diffstat (limited to 'libutil/login_cap.c')
-rw-r--r-- | libutil/login_cap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libutil/login_cap.c b/libutil/login_cap.c index 9c8d4a6..cea7630 100644 --- a/libutil/login_cap.c +++ b/libutil/login_cap.c @@ -86,7 +86,7 @@ allocarray(size_t sz) if (sz <= internal_arraysz) p = internal_array; - else if ((p = realloc(internal_array, sz * sizeof(char*))) != NULL) { + else if ((p = reallocarray(internal_array, sz, sizeof(char*))) != NULL) { internal_arraysz = sz; internal_array = p; } |