Uninitialized variable in PlainDatagramSocketImpl.c

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 8
    • Affects Version/s: None
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: