Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/label/src/gpt.c

    rdeacc58d rb33d140  
    9999        uint8_t *etable[2];
    100100        size_t bsize;
     101        aoff64_t nblocks;
    101102        uint32_t num_entries;
    102103        uint32_t esize;
     
    123124        }
    124125
     126        rc = bd->ops->get_nblocks(bd->arg, &nblocks);
     127        if (rc != EOK) {
     128                rc = EIO;
     129                goto error;
     130        }
     131
    125132        if (bsize < 512 || (bsize % 512) != 0) {
    126133                rc = EINVAL;
     
    147154
    148155        h1ba = uint64_t_le2host(gpt_hdr[0]->alternate_lba);
     156
     157        if (h1ba >= nblocks) {
     158                rc = EINVAL;
     159                goto error;
     160        }
    149161
    150162        rc = bd->ops->read(bd->arg, h1ba, 1, gpt_hdr[1]);
Note: See TracChangeset for help on using the changeset viewer.