]> git.vomp.tv Git - vompserver.git/commitdiff
15 years that line of code has been waiting to crash master
authorChris Tallon <chris@vomp.tv>
Mon, 6 Nov 2023 15:51:03 +0000 (15:51 +0000)
committerChris Tallon <chris@vomp.tv>
Mon, 6 Nov 2023 15:51:03 +0000 (15:51 +0000)
vompclientrrproc.c

index 50dee4eee313137bbeb136ae1bc24a2f5194ac26..940374bce130a50932119d8862a3cfa3f98d79ad 100644 (file)
@@ -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);