File rinetd-secfix.diff of Package rinetd
--- rinetd/rinetd.c
+++ rinetd/rinetd.c
@@ -1071,6 +1071,11 @@
{
goto shortage;
}
+ if (!SAFE_REALLOC(&coClosing, sizeof(int) * o,
+ sizeof(int) * coTotal))
+ {
+ goto shortage;
+ }
if (!SAFE_REALLOC(&reClosed, sizeof(int) * o,
sizeof(int) * coTotal))
{
@@ -1140,7 +1145,7 @@
goto shortage;
}
}
- index = coTotal;
+ index = o;
}
coInputRPos[index] = 0;
coInputWPos[index] = 0;