Skip to content
Snippets Groups Projects
Commit 1def25a2 authored by Adam Lesinski's avatar Adam Lesinski
Browse files

Merge commit '7ac60686' into manualmerge

Change-Id: I671a57d906ca6826722fb892627d235b14b822eb
parents 16092b7a 7ac60686
No related branches found
No related tags found
No related merge requests found
......@@ -25,11 +25,17 @@
#include <cutils/log.h>
#include <cutils/native_handle.h>
static const int kMaxNativeFds = 1024;
static const int kMaxNativeInts = 1024;
native_handle_t* native_handle_create(int numFds, int numInts)
{
native_handle_t* h = malloc(
sizeof(native_handle_t) + sizeof(int)*(numFds+numInts));
if (numFds < 0 || numInts < 0 || numFds > kMaxNativeFds || numInts > kMaxNativeInts) {
return NULL;
}
size_t mallocSize = sizeof(native_handle_t) + (sizeof(int) * (numFds + numInts));
native_handle_t* h = malloc(mallocSize);
if (h) {
h->version = sizeof(native_handle_t);
h->numFds = numFds;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment