Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6639

[classlib][luni]fd's passed c functions needs casting from long to int to avoid potential problems

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • Classlib
    • None
    • All Unix platforms
    • Patch Available

    Description

      fd's passed c functions needs casting from long to int to avoid potential problems

      Consider the functions below. Here fd is jlong. But both the functions will accept int. So this may cause some potential issues.

      mmap(0, (size_t)(size&0x7fffffff), prot, flags, fd-FD_BIAS, (off_t)(alignment&0x7fffffff));
      fstat((int)fd - FD_BIAS, &statbuf)

      typecasting them to int will avoid the truncation issues.

      Attachments

        1. 6639.patch
          1 kB
          Catherine Hope
        2. 6639-2.patch
          1 kB
          Catherine Hope
        3. HARMONY-6639.patch
          1 kB
          Mohanraj Loganathan

        Activity

          People

            hindessm Mark Hindess
            mohlogan Mohanraj Loganathan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: