liblog: fix fd leakage

File descriptors remain open across an exec unless FD_CLOEXEC is
set.  Add O_CLOEXEC to the open() call to prevent file descriptor
leakage.

In particular, the following program will eventually run out of
file descriptors:

int main(int argc, char **argv) {
  printf("===== entering main =====\n");
  ALOGW("entering main");
  system("ls -l /proc/self/fd/");

  execv(argv[0], argv);
  printf("exec failed\n");
  return -1;
}

Change-Id: I5be43ab3b9f82a05f242b1f586454c50568af388
libsparse: Fix null pointer issue

Fix the issue that "out" pointer is dereferenced without checking.

Change-Id: I76a57ad7309841218231346f4807ef2be8628737
Signed-off-by: Hong-Mei Li <a21834@motorola.com>
init: Fix potential null pointer issue

With the old strdup() mechanism, it may return NULL if insufficient memory was
available. So we check the return value or do not use strdup to avoid null
pointer issue.

Change-Id: Id684948d6cb6c2f06327f29a2ba692f9542fce80
Signed-off-by: Hong-Mei Li <a21834@motorola.com>
Revert "core: Fix build in ISO C++11 mode"

This reverts commit 3860ac13da0046a116953c42da711e0c8348f905.
mount: fix incorrect string length calculation

Fix bug https://code.google.com/p/android/issues/detail?id=54192
which incorrectly calculated the length of a string.

Fix compiler warning:

system/core/toolbox/mount.c:59:2: warning: initializer-string for array of chars is too long [enabled by default]
system/core/toolbox/mount.c:59:2: warning: (near initialization for 'options[16].str') [enabled by default]

Change-Id: If8663f8311c6348a730fcf731d402b57fee10cb5
Fix issues where the filename is referred to as 'sideload'

The adb sideload utility referes to the filename as 'sideload' in some
places. This patch changes the printouts to display the filename instead.

Change-Id: I38ada01a08bed53a8d9697c03f55ce8cee2abe12
Signed-off-by: Magnus Eriksson <eriksson.mag@gmail.com>
More libcorkscrew fixes for GCC 4.8+