From 1308b2b17dec6a6988d48c939a8d4209a79ddd4c Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sun, 8 Nov 2020 20:40:45 +0000 Subject: [PATCH] If there is an OS error only print the sense buffer if it contains data. --- Aaru.Core/Logging/ErrorLog.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Aaru.Core/Logging/ErrorLog.cs b/Aaru.Core/Logging/ErrorLog.cs index 57bb02305..c4d54bba2 100644 --- a/Aaru.Core/Logging/ErrorLog.cs +++ b/Aaru.Core/Logging/ErrorLog.cs @@ -454,10 +454,12 @@ namespace Aaru.Core.Logging { _logSw.WriteLine("SCSI reading LBA {0} operating system error: {1}.", block, errno); _logSw.Flush(); - } - if(senseBuffer is null || senseBuffer.Length == 0) - return; + if(senseBuffer is null || + senseBuffer.Length == 0 || + senseBuffer.All(s => s == 0)) + return; + } FixedSense? decodedFixedSense = Sense.DecodeFixed(senseBuffer); DescriptorSense? decodedDescriptorSense = Sense.DecodeDescriptor(senseBuffer);