Changeset 3641


Ignore:
Timestamp:
Apr 12, 2013, 5:43:39 AM (13 months ago)
Author:
quozl
Message:

disklabel - fix no access to primary partition if extended partition is empty, workaround is to set the primary partition bootable, cause in the partition finder which when recursing reused the same buffer for the extended partition, destroying the in-memory copy of the primary parition; fix is to use a separate buffer in the recursion. Reported by Vladimir Serbinenko.

Location:
ofw
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ofw/disklabel/common.fth

    r3068 r3641  
    1919 
    20200 instance value sector-offset 
     21 
     22: sector-alloc  ( -- )  /sector alloc-mem to sector-buf  ; 
     23: sector-free  ( -- )  sector-buf /sector free-mem  ; 
    2124 
    2225\ For ISO-9660 CD-ROMs, ISO-9660 flash or hard drives, and GPT 
  • ofw/disklabel/methods.fth

    r2943 r3641  
    234234: try-open  ( -- ) 
    235235   " block-size" $call-parent to /sector 
    236    /sector alloc-mem to sector-buf 
     236   sector-alloc 
    237237   parse-partition      ( ) 
    238238   select-partition     ( ) 
     
    249249\ intercepts the abort and returns the appropriate flag value. 
    250250: open  ( -- okay? )  ['] try-open  catch  0=  ; 
    251 : close  ( -- )  sector-buf  if  sector-buf /sector free-mem  then  ; 
     251: close  ( -- )  sector-buf  if  sector-free  then  ; 
    252252: size  ( -- d )  size-low size-high  ; 
    253253: load  ( adr -- len ) 
  • ofw/fs/fatfs/partition.fth

    r2416 r3641  
    9191               2drop nip                                ( ... s ) 
    9292               extended-offset dup 0=  if  over to extended-offset  then 
    93                + dup read-sector recurse drop           ( ... ) 
     93               + dup                                    ( ... es ) 
     94               sector-buf >r sector-alloc               ( ... es ) 
     95               read-sector recurse drop                 ( ... ) 
     96               sector-free r> to sector-buf             ( ... ) 
    9497            else                \ Ordinary partition    ( ... n,s,b,t ) 
    9598               suitable?  if                            ( ... n,s,b,t ) 
Note: See TracChangeset for help on using the changeset viewer.