Skip to content
Permalink
Browse files

Fixed crash triggered by reading large files referenced in the clipbo…

…ard.

- ServerItem::fromMimeData has functionality to parse .url. To that end
  files from the clipboard were read into memory to be parsed. However
  there was no restriction placed on file-size. If triggered while a big
  file was in the clipboard Mumble attempted to read all of it into memory
  and consequently crashed.
- Now limiting permissible file-size for such files to 10K which should be
  plenty and prevent future crashes.
  • Loading branch information...
hacst authored and Kissaki committed Jun 1, 2013
1 parent 398b773 commit 77233edf13ee80d818ccc1a3c63ab9344c753edd
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/mumble/ConnectDialog.cpp
@@ -370,7 +370,10 @@ ServerItem *ServerItem::fromMimeData(const QMimeData *mime, QWidget *p) {
QString qsFile = url.toLocalFile();
if (! qsFile.isEmpty()) {
QFile f(qsFile);
if (f.open(QIODevice::ReadOnly)) {
// Make sure we don't accidently read something big the user
// happened to have in his clipboard. We only want to look
// at small link files.
if (f.open(QIODevice::ReadOnly) && f.size() < 10240) {
QByteArray qba = f.readAll();
f.close();

0 comments on commit 77233ed

Please sign in to comment.
You can’t perform that action at this time.