Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8048189

sun.security.krb5.internal.ktab.KeyTab.load() will enter endless loop

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 7u11
    • security-libs

      FULL PRODUCT VERSION :
      java version "1.7.0_11"

      ADDITIONAL OS VERSION INFORMATION :
      windows 7 32bit
      Linux 2.6.32-358.18.1.el6.x86_64

      A DESCRIPTION OF THE PROBLEM :
      KeyTab.class will parse the keytab file and get KeyTabEntry info:
          private void load(KeyTabInputStream kis)
              throws IOException, RealmException {
              .............
              .............
              while (kis.available() > 0) {
                  entryLength = kis.readEntryLength();
                  entry = kis.readEntry(entryLength, kt_vno);
                  if (DEBUG) {
                      System.out.println(">>> KeyTab: load() entry length: " +
                              entryLength + "; type: " +
                              (entry != null? entry.keyType : 0));
                  }
                  if (entry != null)
                      entries.addElement(entry);
              }
          }
      In some scenarios kis.available() will always return positive number(Integer.MAX_VALUE),never exit the while loop.
      consider this scenarios as folows:
      1. load corrupt keytab file
      2. after read(), reached the end of file
      3. call skip()
      4. kis.available() will always return Integer.MAX_VALUE


      REPRODUCIBILITY :
      This bug can be reproduced always.

            weijun Weijun Wang
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: