This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Two natFile.cc questions


Right now natFile.cc has code like this throughout:

  char buf[MAXPATHLEN];
  jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf);
  buf[total] = '\0';

This is pretty bad.  What if the UTF-8 encoded `path' is longer than
MAXPATHLEN?  Security hole!

I was about to fix this when I thought: maybe we should take this
opportunity to use `file.encoding' as the encoding for file names.
However, I'm reluctant to do this without knowing whether it is really
the correct thing to do.  Does anyone have a definitive answer?

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]