harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Catherine Hope (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-6639) [classlib][luni]fd's passed c functions needs casting from long to int to avoid potential problems
Date Wed, 01 Sep 2010 09:32:54 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-6639?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Catherine Hope updated HARMONY-6639:
------------------------------------

    Attachment: 6639.patch

The other native function calls (readv and writev) in OSFileSystemLinux32.c also don't have
the int cast.  I did a global search through the rest of the native files and didn't find
any other places where the cast isn't been done.
Patch contains Mohan's fix (minus the comment) and the extra casts and improved error message
for the IOException throw

> [classlib][luni]fd's passed c functions needs casting from long to int to avoid potential
problems
> --------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6639
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6639
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: All Unix platforms 
>            Reporter: Mohanraj Loganathan
>         Attachments: 6639.patch, HARMONY-6639.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message