summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramFragmentFixedFunction.java
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2019-06-12 16:57:59 -0700
committerJohn Reck <jreck@google.com>2019-06-13 14:53:52 -0700
commit121e478ed4e5d1d93826c3015e0006055d03b24d (patch)
tree502a91c96007d93ce12761cfaabbdd1b2ea57a1c /rs/java/android/renderscript/ProgramFragmentFixedFunction.java
parent4cd89f0332a3bbf5577763e444dc86581ca03771 (diff)
Fix buffer overflow in Trace's JNI layer
There doesn't appear to be anything better than blindly make a buffer 4x the length of a jstring if a maximum buffer size is useful. So do that. This does slightly regress Trace's performance. Before: android.os.TracePerfTest:INSTRUMENTATION_STATUS: enabled_mean=14 INSTRUMENTATION_STATUS: enabled_median=14 INSTRUMENTATION_STATUS: enabled_min=14 INSTRUMENTATION_STATUS: enabled_standardDeviation=0 INSTRUMENTATION_STATUS_CODE: -1 .INSTRUMENTATION_STATUS: beginEndSection_mean=3087 INSTRUMENTATION_STATUS: beginEndSection_median=3059 INSTRUMENTATION_STATUS: beginEndSection_min=3020 INSTRUMENTATION_STATUS: beginEndSection_standardDeviation=75 INSTRUMENTATION_STATUS_CODE: -1 .INSTRUMENTATION_STATUS: counter_mean=1893 INSTRUMENTATION_STATUS: counter_median=1900 INSTRUMENTATION_STATUS: counter_min=1851 INSTRUMENTATION_STATUS: counter_standardDeviation=26 INSTRUMENTATION_STATUS_CODE: -1 .INSTRUMENTATION_STATUS: asyncBeginEnd_mean=4281 INSTRUMENTATION_STATUS: asyncBeginEnd_median=4306 INSTRUMENTATION_STATUS: asyncBeginEnd_min=4184 INSTRUMENTATION_STATUS: asyncBeginEnd_standardDeviation=65 INSTRUMENTATION_STATUS_CODE: -1 After: android.os.TracePerfTest:INSTRUMENTATION_STATUS: enabled_mean=16 INSTRUMENTATION_STATUS: enabled_median=16 INSTRUMENTATION_STATUS: enabled_min=16 INSTRUMENTATION_STATUS: enabled_standardDeviation=0 INSTRUMENTATION_STATUS_CODE: -1 .INSTRUMENTATION_STATUS: beginEndSection_mean=3869 INSTRUMENTATION_STATUS: beginEndSection_median=3864 INSTRUMENTATION_STATUS: beginEndSection_min=3840 INSTRUMENTATION_STATUS: beginEndSection_standardDeviation=21 INSTRUMENTATION_STATUS_CODE: -1 .INSTRUMENTATION_STATUS: counter_mean=2511 INSTRUMENTATION_STATUS: counter_median=2503 INSTRUMENTATION_STATUS: counter_min=2480 INSTRUMENTATION_STATUS: counter_standardDeviation=35 INSTRUMENTATION_STATUS_CODE: -1 .INSTRUMENTATION_STATUS: asyncBeginEnd_mean=5348 INSTRUMENTATION_STATUS: asyncBeginEnd_median=5344 INSTRUMENTATION_STATUS: asyncBeginEnd_min=5318 INSTRUMENTATION_STATUS: asyncBeginEnd_standardDeviation=28 INSTRUMENTATION_STATUS_CODE: -1 But it also works correctly and doesn't crash, and that seems worth it. Fixes: 133104515 Test: systrace still works, AtraceHostTest passes, verified Trace.beginSection of 4-byte utf8 octets showed up in systrace Change-Id: Ie2e31227d9380df4190f9bc09ecd67f8a982827f
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions