Print this page
3194 dis crashes disassembling aes

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/dis/dis_target.c
          +++ new/usr/src/cmd/dis/dis_target.c
↓ open down ↓ 711 lines elided ↑ open up ↑
 712  712  #if !defined(__sparc)
 713  713  /*
 714  714   * Given an address, return the starting offset of the next symbol in the file.
 715  715   * Only needed on variable length instruction architectures.
 716  716   */
 717  717  off_t
 718  718  dis_tgt_next_symbol(dis_tgt_t *tgt, uint64_t addr)
 719  719  {
 720  720          sym_entry_t *sym;
 721  721  
 722      -        for (sym = tgt->dt_symcache;
 723      -            sym != tgt->dt_symtab + tgt->dt_symcount;
 724      -            sym++) {
      722 +        sym = (tgt->dt_symcache != NULL) ? tgt->dt_symcache : tgt->dt_symtab;
      723 +
      724 +        while (sym != (tgt->dt_symtab + tgt->dt_symcount)) {
 725  725                  if (sym->se_sym.st_value >= addr)
 726  726                          return (sym->se_sym.st_value - addr);
      727 +                sym++;
 727  728          }
 728  729  
 729  730          return (0);
 730  731  }
 731  732  #endif
 732  733  
 733  734  /*
 734  735   * Iterate over all sections in the target, executing the given callback for
 735  736   * each.
 736  737   */
↓ open down ↓ 224 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX