blob: 34ded2d857861b344b6c0eab267320bba0935355 [file] [log] [blame]
Andrew Geissler09209ee2020-12-13 08:44:15 -06001From 02b222a335527f1031cc9495d8c5ebc1bc5b1d4e Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3Date: Wed, 11 Nov 2020 15:00:47 +0100
4Subject: [PATCH] quota: Use realloc(3) instead of reallocarray(3)
5
6reallocarray(3) has been added to glibc relatively recently (version
72.26, from 2017) and apparently not all users run new enough glibc. Just
8use realloc(3) for now since in this case there's no real risk of
9overflow.
10
11Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
12Signed-off-by: Jan Kara <jack@suse.cz>
13Upstream-Status: Backport
14Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
15---
16 quota.c | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/quota.c b/quota.c
20index a6ed61f..a60de12 100644
21--- a/quota.c
22+++ b/quota.c
23@@ -385,7 +385,7 @@ int main(int argc, char **argv)
24 break;
25 case 259:
26 fscount++;
27- fsnames = reallocarray(fsnames, fscount, sizeof(char *));
28+ fsnames = realloc(fsnames, fscount * sizeof(char *));
29 if (!fsnames)
30 die(1, _("Not enough memory for filesystem names"));
31 fsnames[fscount - 1] = optarg;
32--
332.17.1
34