Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-3397

inet_addr crashes on null pointer

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • None
    • Networking
    • None
    • Operating System: ReactOS
      Platform: x86 Hardware

    Description

      If reactos\dll\win32\ws2_32\misc\ns.c:1286 inet_addr parameter cp (pointer to ipv4 address) is null the function crashes, because it tries to read at 0x00000000.

      Testcase for win behaviour (needs to be linked against Ws2_32.lib):

      #include <stdio.h>
      #include <Winsock2.h>

      int main(int argc, char* argv)
      {
      const char *addr = NULL;
      unsigned long bin = inet_addr(addr);
      printf("addr=%s, binary:%d, Error=%d\n", addr, bin, GetLastError());
      getchar();
      return 0;
      }

      inet_addr returns '-1' or '4294967295' for error and sets LastError to 10014/WSAEFAULT.

      Filezilla uses this function with a null pointer (don't know why it does that though) and can't start on ros due to this crash.

      Attachments

        Activity

          People

            bug zilla Bug Zilla
            grschneider Gregor Schneider
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: