tjibbevanderlaan / chromeos-filesystem-sftp

ChromeOS app to access SFTP server
https://chrome.google.com/webstore/detail/shared-network-folder-sft/gbheifiifcfekkamhepkeogobihicgmn
BSD 3-Clause "New" or "Revised" License
82 stars 21 forks source link

Uncaught TypeError: Cannot read property 'split' of null #94

Open nerdatmath opened 9 years ago

nerdatmath commented 9 years ago

getNameFromPath @ background.js:512 (anonymous function) @ background.js:302 (anonymous function) @ background.js:227

This is in version 1.7.8 on a Chromebook Pixel 2, connecting to openssl on a linux machine.

nerdatmath commented 9 years ago

This happens when reading a directory with a file that has a name containing a character that is invalid utf-8 (it's Latin-1, but my LANG is set to en_US.UTF-8). In this case, F6 followed by 6E. It appears the NaCl module sets the name field to null in that case.

yoichiro commented 9 years ago

@mattharden Hmm... Could you teach me how to reproduce this issue? For instance, should I create a file which has the name including an invalid character as the UTF-8? And, do you have such character codes?

nerdatmath commented 9 years ago

Create a file name with any character >= 128 in Latin-1 followed by a character <128. For example, the Spanish word mañana, in Latin-1 is hex 6D61F1616E61. F161 is not a valid UTF-8 sequence so you will trigger the bug when listing the directory containing this file.

The word can of course be correctly encoded in UTF-8. The problem only happens in when the encoding used for the file name is different from the expected encoding.