summaryrefslogtreecommitdiffstats
path: root/tools/aidl
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-10-29 13:12:55 -0700
committerElliott Hughes <enh@google.com>2013-10-29 13:12:55 -0700
commitc367d48c55e5a3fa0df14fd62889e4bb6b63cb01 (patch)
treecc6a7e56e5c5e74d66603c8170660fd99c52bff3 /tools/aidl
parentb4cae4a955ebd91cf35aaeb00ab12ce6f1d5fc48 (diff)
downloadframeworks_base-c367d48c55e5a3fa0df14fd62889e4bb6b63cb01.zip
frameworks_base-c367d48c55e5a3fa0df14fd62889e4bb6b63cb01.tar.gz
frameworks_base-c367d48c55e5a3fa0df14fd62889e4bb6b63cb01.tar.bz2
Fix a variety of small publicly-reported bugs.
Possible NULL dereference in cmds/bootanimation/BootAnimation.cpp. https://code.google.com/p/android/issues/detail?id=61556 Missing fclose in core/jni/android_os_Debug.cpp. https://code.google.com/p/android/issues/detail?id=61546 Bad loop guards in core/jni/android_util_Process.cpp. https://code.google.com/p/android/issues/detail?id=61557 Assignment to wrong variable in libs/androidfw/AssetManager.cpp. https://code.google.com/p/android/issues/detail?id=61560 Missing delete[]s in libs/androidfw/ObbFile.cpp. https://code.google.com/p/android/issues/detail?id=61549 Leaks on error in tools/aapt/Images.cpp. https://code.google.com/p/android/issues/detail?id=61552 Two missing fclose calls in tools/aapt/Resource.cpp. https://code.google.com/p/android/issues/detail?id=61553 Missing fclose in tools/aidl/aidl.cpp. https://code.google.com/p/android/issues/detail?id=61554 Change-Id: I5820f3824e72d07a9acb776cf0af3e7443f5694a
Diffstat (limited to 'tools/aidl')
-rw-r--r--tools/aidl/aidl.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/aidl/aidl.cpp b/tools/aidl/aidl.cpp
index 071a8d7..b5c3da9 100644
--- a/tools/aidl/aidl.cpp
+++ b/tools/aidl/aidl.cpp
@@ -207,7 +207,7 @@ check_filename(const char* filename, const char* package, buffer_type* name)
p = strchr(name->data, '.');
len = p ? p-name->data : strlen(name->data);
expected.append(name->data, len);
-
+
expected += ".aidl";
len = fn.length();
@@ -473,7 +473,7 @@ check_method(const char* filename, int kind, method_type* m)
err = 1;
goto next;
}
-
+
if (!(kind == INTERFACE_TYPE_BINDER ? t->CanWriteToParcel() : t->CanWriteToRpcData())) {
fprintf(stderr, "%s:%d parameter %d: '%s %s' can't be marshalled.\n",
filename, m->type.type.lineno, index,
@@ -536,7 +536,7 @@ check_method(const char* filename, int kind, method_type* m)
filename, m->name.lineno, index, arg->name.data);
err = 1;
}
-
+
next:
index++;
arg = arg->next;
@@ -787,7 +787,7 @@ parse_preprocessed_file(const string& filename)
//printf("%s:%d:...%s...%s...%s...\n", filename.c_str(), lineno,
// type, packagename, classname);
document_item_type* doc;
-
+
if (0 == strcmp("parcelable", type)) {
user_data_type* parcl = (user_data_type*)malloc(
sizeof(user_data_type));
@@ -837,6 +837,7 @@ parse_preprocessed_file(const string& filename)
else {
fprintf(stderr, "%s:%d: bad type in line: %s\n",
filename.c_str(), lineno, line);
+ fclose(f);
return 1;
}
err = gather_types(filename.c_str(), doc);
@@ -1093,13 +1094,13 @@ preprocess_aidl(const Options& options)
}
// write preprocessed file
- int fd = open( options.outputFileName.c_str(),
+ int fd = open( options.outputFileName.c_str(),
O_RDWR|O_CREAT|O_TRUNC|O_BINARY,
#ifdef HAVE_MS_C_RUNTIME
_S_IREAD|_S_IWRITE);
-#else
+#else
S_IRUSR|S_IWUSR|S_IRGRP);
-#endif
+#endif
if (fd == -1) {
fprintf(stderr, "aidl: could not open file for write: %s\n",
options.outputFileName.c_str());