diff options
| author | Elliott Hughes <enh@google.com> | 2013-10-29 14:12:46 -0700 |
|---|---|---|
| committer | Elliott Hughes <enh@google.com> | 2013-10-29 14:12:46 -0700 |
| commit | 14e28d39f7f094225c1ddae8fa43bd792c621a8f (patch) | |
| tree | f4d986698864a59ea87af253247753768916be37 /fastboot | |
| parent | 98f87d92d89079f274374409efcf57ca52b13c1f (diff) | |
| download | system_core-14e28d39f7f094225c1ddae8fa43bd792c621a8f.tar.gz system_core-14e28d39f7f094225c1ddae8fa43bd792c621a8f.tar.bz2 system_core-14e28d39f7f094225c1ddae8fa43bd792c621a8f.zip | |
Fix a bunch of small system/core bugs.
Missing frees in:
adb/file_sync_client.c
fastboot/fastboot.c
libsparse/output_file.c
Missing closedirs in:
adb/file_sync_service.c
cpio/mkbootfs.c
libcutils/dir_hash.c
Potential buffer overrun in:
gpttool/gpttool.c
Incorrect NULL check in:
libsparse/backed_block.c
Bug: https://code.google.com/p/android/issues/detail?id=61564
Change-Id: If97838a9e73a77aef7f416c31c237ce1fca4ce21
Diffstat (limited to 'fastboot')
| -rw-r--r-- | fastboot/Android.mk | 1 | ||||
| -rw-r--r-- | fastboot/fastboot.c | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/fastboot/Android.mk b/fastboot/Android.mk index f33998876..b9b3c92cc 100644 --- a/fastboot/Android.mk +++ b/fastboot/Android.mk @@ -21,6 +21,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../mkbootimg \ LOCAL_SRC_FILES := protocol.c engine.c bootimg.c fastboot.c util.c LOCAL_MODULE := fastboot LOCAL_MODULE_TAGS := debug +LOCAL_CFLAGS += -std=gnu99 ifeq ($(HOST_OS),linux) LOCAL_SRC_FILES += usb_linux.c util_linux.c diff --git a/fastboot/fastboot.c b/fastboot/fastboot.c index 70b838f03..da2af416e 100644 --- a/fastboot/fastboot.c +++ b/fastboot/fastboot.c @@ -449,7 +449,13 @@ static int setup_requirement_line(char *name) for(n = 0; n < count; n++) { out[n] = strdup(strip(val[n])); - if (out[n] == 0) return -1; + if (out[n] == 0) { + for(size_t i = 0; i < n; ++i) { + free((char*) out[i]); + } + free(out); + return -1; + } } fb_queue_require(prod, name, invert, n, out); |
