summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamkumar Radhakrishnan <ramkumar@codeaurora.org>2016-05-18 18:56:05 -0700
committerSteve Kondik <steve@cyngn.com>2016-07-20 04:16:16 -0700
commitd67b177ff6a6dbbd950f1aaa84669351d6f26b9e (patch)
tree7b04ec33501ac49669737ba9908331d10625bc98
parenta887c19994c7873fbe651e2fe944a176576a6198 (diff)
downloadframeworks_native-d67b177ff6a6dbbd950f1aaa84669351d6f26b9e.zip
frameworks_native-d67b177ff6a6dbbd950f1aaa84669351d6f26b9e.tar.gz
frameworks_native-d67b177ff6a6dbbd950f1aaa84669351d6f26b9e.tar.bz2
SF: Fix NULL pointer dereferencing in dumpDrawCycle()
Check for NULL before dereferencing a pointer in dumpDrawCycle() Change-Id: I1f06214577d0065c988877acb0f1b4378080690f CRs-Fixed: 1018335
-rw-r--r--services/surfaceflinger/ExSurfaceFlinger/ExSurfaceFlinger.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/surfaceflinger/ExSurfaceFlinger/ExSurfaceFlinger.cpp b/services/surfaceflinger/ExSurfaceFlinger/ExSurfaceFlinger.cpp
index 96d4b1d..7be0328 100644
--- a/services/surfaceflinger/ExSurfaceFlinger/ExSurfaceFlinger.cpp
+++ b/services/surfaceflinger/ExSurfaceFlinger/ExSurfaceFlinger.cpp
@@ -335,6 +335,10 @@ void ExSurfaceFlinger::dumpDrawCycle(bool prePrepare) {
gettimeofday(&tv, NULL);
ptm = localtime(&tv.tv_sec);
+ if (ptm == NULL) {
+ return;
+ }
+
strftime (hms, sizeof (hms), "%H:%M:%S", ptm);
millis = tv.tv_usec / 1000;
snprintf(timeStamp, sizeof(timeStamp), "Timestamp: %s.%03ld", hms, millis);