NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: toolchain/54703: GCC 8 breaks i386 floppy install



i have tracked this down to a bad strncmp() in ustarfs.c:

---
      /* if volume metadata is found, use it */
      if(strncmp(ustf->uas_active.ust_name, metaname,
          strlen(metaname)) == 0) {
              ustarfs_sscanf(ustf->uas_active.ust_name
                      + strlen(metaname), "%99o", &newvolblocks);
              ustf->uas_volsize = newvolblocks * 512
                                - lda2pda(0);
---

this strncmp() gets 'ust_name' of 'boot', and 'metaname'
is the static string "USTAR.volsize.", yet this block is
executed, and the sscanf() writes 0 to newvolblocks, and
then uas_volsize becomes -8K (from lda2pda(0).)


Home | Main Index | Thread Index | Old Index