projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
36084d7
)
usb-mtp: handle lseek failure
author
Gerd Hoffmann
<kraxel@redhat.com>
Tue, 20 May 2014 11:02:26 +0000
(13:02 +0200)
committer
Gerd Hoffmann
<kraxel@redhat.com>
Mon, 26 May 2014 06:41:07 +0000
(08:41 +0200)
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/dev-mtp.c
patch
|
blob
|
history
diff --git
a/hw/usb/dev-mtp.c
b/hw/usb/dev-mtp.c
index c2750e4bd20fa757002ed7281aa463c23213e1a9..a95298bd3402921d6ecf1427f9d7e6604c709679 100644
(file)
--- a/
hw/usb/dev-mtp.c
+++ b/
hw/usb/dev-mtp.c
@@
-702,7
+702,10
@@
static MTPData *usb_mtp_get_partial_object(MTPState *s, MTPControl *c,
if (offset > o->stat.st_size) {
offset = o->stat.st_size;
}
- lseek(d->fd, offset, SEEK_SET);
+ if (lseek(d->fd, offset, SEEK_SET) < 0) {
+ usb_mtp_data_free(d);
+ return NULL;
+ }
d->length = c->argv[2];
if (d->length > o->stat.st_size - offset) {