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

Uninitialized variable in PlainDatagramSocketImpl.c

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • None
    • core-libs
    • b63
    • solaris
    • Verified

      The variable "optlen" that's defined in the function: Java_java_net_PlainDatagramSocketImpl_socketSetOption, in the source code file: /jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c may be passed to NET_SetSockOpt at line 1582 without being initialized.

      I determined that the variable IS initialized and always initialized to the very same value: sizeof(int) in every case. To prevent parfait from flagging this "error" in the future, I added a line of code that initializes optval to the value: sizeof(int) at the beginning of the procedure.

      Parfait no longer detects an error.

            jzavgren John Zavgren (Inactive)
            jzavgren John Zavgren (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: