summaryrefslogtreecommitdiff
path: root/src/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/process.c b/src/process.c
index 236c27e5c3a..31359a1f1f2 100644
--- a/src/process.c
+++ b/src/process.c
@@ -3567,6 +3567,12 @@ format; see the description of ADDRESS in `make-network-process'. */)
return Qnil;
again:
+ if (min (INT_MAX, min (PTRDIFF_MAX, SIZE_MAX)) / sizeof *ifreqs - 25
+ < ifaces)
+ {
+ xfree (ifreqs);
+ memory_full (SIZE_MAX);
+ }
ifaces += 25;
buf_size = ifaces * sizeof (ifreqs[0]);
ifreqs = (struct ifreq *)xrealloc(ifreqs, buf_size);