am a29997ae: am 470f0b3f: Merge "Avoid segv by checking argc in "storage user <mountpoint>""

* commit 'a29997ae260d3d7cf41c40d9c7ba42b761b12d30':
  Avoid segv by checking argc in "storage user <mountpoint>"
This commit is contained in:
JP Abgrall 2014-03-12 20:35:03 +00:00 committed by Android Git Automerger
commit df7382e477

View file

@ -240,6 +240,10 @@ int CommandListener::StorageCmd::runCommand(SocketClient *cli,
DIR *dir; DIR *dir;
struct dirent *de; struct dirent *de;
if (argc < 3) {
cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing Argument: user <mountpoint>", false);
return 0;
}
if (!(dir = opendir("/proc"))) { if (!(dir = opendir("/proc"))) {
cli->sendMsg(ResponseCode::OperationFailed, "Failed to open /proc", true); cli->sendMsg(ResponseCode::OperationFailed, "Failed to open /proc", true);
return 0; return 0;