VirtualBox

Ignore:
Timestamp:
Nov 8, 2017 12:11:36 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
118973
Message:

EFI/HFS: Fixed a problem with null character comparison on HFS+ volumes which in rare cases led to a failure to access most files on the volume.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxFsDxe/fsw_hfs.c

    r69500 r69613  
    3737
    3838#ifdef HOST_POSIX
     39#include <assert.h>
    3940#define DPRINT(x) printf(x)
    4041#define DPRINT2(x,y) printf(x,y)
    41 #define BP(msg)    do { printf("ERROR: %s", msg); asm("int3"); } while (0)
     42#define BP(msg)    do { printf("ERROR: %s", msg); assert(0); } while (0)
    4243#elif defined DEBUG_LEVEL
    4344#define CONCAT(x,y) x##y
     
    928929  while(1)
    929930  {
    930     /* get next valid character from ckey1 */
     931    /* get next valid (non-zero) character from ckey1 */
    931932    for (lc = 0; lc == 0 && apos < key1Len; apos++) {
    932933      ac = be16_to_cpu(p1[apos]);
    933       lc = ac ? fsw_to_lower(ac) : 0;
     934      lc = fsw_to_lower(ac);    /* NB: 0x0000 is translated to 0xffff */
    934935    };
    935936    ac = (fsw_u16)lc;
    936937
    937     /* get next valid character from ckey2 */
     938    /* get next valid (non-zero) character from ckey2 */
    938939    for (lc = 0; lc == 0 && bpos < ckey2->nodeName.length; bpos++) {
    939940      bc = p2[bpos];
    940       lc = bc ? fsw_to_lower(bc) : 0;
     941      lc = fsw_to_lower(bc);    /* NB: 0x0000 is translated to 0xffff */
    941942    };
    942943    bc = (fsw_u16)lc;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette