hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "V. Karthik Kumar (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HADOOP-9635) Potential Stack Overflow in DomainSocket.c
Date Sun, 09 Jun 2013 00:21:20 GMT
V. Karthik Kumar created HADOOP-9635:

             Summary: Potential Stack Overflow in DomainSocket.c
                 Key: HADOOP-9635
                 URL: https://issues.apache.org/jira/browse/HADOOP-9635
             Project: Hadoop Common
          Issue Type: Bug
          Components: native
    Affects Versions: 2.3.0
         Environment: OSX 10.8
            Reporter: V. Karthik Kumar

When I was running on OSX, the DataNode was segfaulting. On investigation, it was tracked
down to this code. A potential stack overflow was also identified. 

   utfLength = (*env)->GetStringUTFLength(env, jstr);
   if (utfLength > sizeof(path)) {
     jthr = newIOException(env, "path is too long!  We expected a path "
         "no longer than %zd UTF-8 bytes.", sizeof(path));
     goto done;
  // GetStringUTFRegion does not pad with NUL
   (*env)->GetStringUTFRegion(env, jstr, 0, utfLength, path);


  //strtok_r can set rest pointer to NULL when no tokens found.
  //Causes JVM to crash in rest[0]
   for (check[0] = '/', check[1] = '\0', rest = path, token = "";
       token && rest[0];
        token = strtok_r(rest, "/", &rest)) {

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message