From 269b046dec4187142a3ceaf1a90fb0f049a88000 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Mon, 6 Nov 2023 15:51:03 +0000 Subject: [PATCH] 15 years that line of code has been waiting to crash --- vompclientrrproc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vompclientrrproc.c b/vompclientrrproc.c index 50dee4e..940374b 100644 --- a/vompclientrrproc.c +++ b/vompclientrrproc.c @@ -750,7 +750,9 @@ int VompClientRRProc::processGetRecordingsList() #else int Percent = VideoDiskSpace(&FreeMB); #endif - int Total = (FreeMB / (100 - Percent)) * 100; + // int Total = (FreeMB / (100 - Percent)) * 100; + int Total = 0; // This was never used, which explains why nobody noticed it's total rubbish anyway. + // Also it breaks with a lovely divide by 0 crash when your storage gets full. resp->addULONG(Total); resp->addULONG(FreeMB); -- 2.39.5