File smartmontools-command-convert2.patch of Package smartmontools

--- os_linux.cpp
+++ os_linux.cpp
@@ -426,9 +426,11 @@
 
 
 #define BUFFER_LEN (4+512)
+#define STRANGE_BUFFER_LENGTH (4+512*0xf8)
 
 int ata_command_interface(int device, smart_command_set command, int select, char *data){
-  unsigned char buff[BUFFER_LEN];
+  // buff must be large enough to cover both STRANGE_BUFFER_LENGTH and BUFFER_LEN
+  unsigned char buff[STRANGE_BUFFER_LENGTH];
   // positive: bytes to write to caller.  negative: bytes to READ from
   // caller. zero: non-data command
   int copydata=0;
openSUSE Build Service is sponsored by