OSDN Git Service
(root)
/
android-x86
/
external-exfat.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
542774e
)
Add check of malloc() return value.
author
relan
<relan@users.noreply.github.com>
Thu, 17 Sep 2009 18:50:06 +0000
(18:50 +0000)
committer
relan
<relan@users.noreply.github.com>
Mon, 24 Aug 2015 05:26:09 +0000
(08:26 +0300)
libexfat/lookup.c
patch
|
blob
|
history
diff --git
a/libexfat/lookup.c
b/libexfat/lookup.c
index
a125895
..
4aa46b1
100644
(file)
--- a/
libexfat/lookup.c
+++ b/
libexfat/lookup.c
@@
-147,6
+147,12
@@
int exfat_readdir(struct exfat* ef, struct exfat_node* node,
return -EIO;
}
ef->upcase = malloc(le64_to_cpu(upcase->size));
+ if (ef->upcase == NULL)
+ {
+ exfat_error("failed to allocate upcase table (%"PRIu64" bytes)",
+ le64_to_cpu(upcase->size));
+ return -ENOMEM;
+ }
ef->upcase_chars = le64_to_cpu(upcase->size) / sizeof(le16_t);
/* set up a few fields in node just to satisfy exfat_read() */