hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-10527) libhdfs++: hdfsGetBlockLocations doesn't null terminate ip address strings
Date Thu, 22 Mar 2018 21:58:05 GMT

    [ https://issues.apache.org/jira/browse/HDFS-10527?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16410431#comment-16410431
] 

Hudson commented on HDFS-10527:
-------------------------------

SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #13869 (See [https://builds.apache.org/job/Hadoop-trunk-Commit/13869/])
HDFS-10527: libhdfs++: hdfsGetBlockLocations doesn't null terminate ip (james.clampffer: rev
de6fce7817af6232a92a300eb89974a8c8803560)
* (edit) hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/bindings/c/hdfs.cc


> libhdfs++: hdfsGetBlockLocations doesn't null terminate ip address strings
> --------------------------------------------------------------------------
>
>                 Key: HDFS-10527
>                 URL: https://issues.apache.org/jira/browse/HDFS-10527
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: hdfs-client
>            Reporter: James Clampffer
>            Assignee: James Clampffer
>            Priority: Major
>         Attachments: HDFS-10527.HDFS-8707.000.patch
>
>
> Code looks like this
> {code}
> strncpy(buf, ipaddr.c_str(),ipaddr.size());
> {code}
> But should be
> {code}
> strncpy(buf, ipaddr.c_str(),ipaddr.size()+1);
> {code}
> In order to make sure there is at least 1 null terminating byte.  If we could run the
minidfscluster an another process and run valgrind on the libhdfs++ tests this would show
up really quickly as a sequence of invalid reads when that const char* was passed to std::string::string(const
char*), strlen, or strcpy.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message