Skip to content

Commit

Permalink
atacmds.cpp: fix a logical error in function ataReadExtSelfTestLog
Browse files Browse the repository at this point in the history
where it failed to byte-swap timestamp values on big-endian
platforms except in the first log entry (#1696).

Patch by WHR.

git-svn-id: https://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools@5456 4ea69e1a-61f1-4043-bf83-b5c94c648137
  • Loading branch information
chrfranke committed Feb 14, 2023
1 parent 9c9fdc1 commit a8c426a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
$Id$

2023-02-14 WHR <[email protected]>

atacmds.cpp: fix a logical error in function ataReadExtSelfTestLog
where it failed to byte-swap timestamp values on big-endian
platforms except in the first log entry (#1696).

2023-02-11 Douglas Gilbert <[email protected]>

more RSOC work (see 2023-01-11 patch). Simplify
Expand Down
4 changes: 2 additions & 2 deletions atacmds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1067,10 +1067,10 @@ bool ataReadExtSelfTestLog(ata_device * device, ata_smart_extselftestlog * log,
check_multi_sector_sum(log, nsectors, "SMART Extended Self-test Log Structure");

if (isbigendian()) {
SWAPV(log->log_desc_index);
for (unsigned i = 0; i < nsectors; i++) {
SWAPV(log[i].log_desc_index);
for (unsigned j = 0; j < 19; j++)
SWAPV(log->log_descs[i].timestamp);
SWAPV(log[i].log_descs[j].timestamp);
}
}
return true;
Expand Down

0 comments on commit a8c426a

Please sign in to comment.