|
|
Created:
5 years, 6 months ago by hal.canary Modified:
5 years, 6 months ago Reviewers:
bungeman-skia CC:
reviews_skia.org Base URL:
https://skia.googlesource.com/skia.git@master Target Ref:
refs/heads/master Project:
skia Visibility:
Public. |
DescriptionSkPDF: fix name escape code
BUG=494913
Committed: https://skia.googlesource.com/skia/+/8ca89e18f54dcc9f18c17aff4d49791b310c4eeb
Patch Set 1 #
Total comments: 2
Patch Set 2 : 2015-06-08 (Monday) 11:21:10 EDT #Patch Set 3 : 2015-06-08 (Monday) 11:53:55 EDT #
Total comments: 4
Patch Set 4 : 2015-06-08 (Monday) 13:47:48 EDT #Messages
Total messages: 23 (9 generated)
The CQ bit was checked by halcanary@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1152283014/1
halcanary@google.com changed reviewers: + bungeman@google.com
PTAL
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by halcanary@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1152283014/20001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot on client.skia (JOB_FAILED, http://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2...) Build-Ubuntu-Clang-x86_64-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu-Clang-x...) Build-Ubuntu-GCC-Mips-Debug-Android-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu-GCC-Mip...)
I would very much like to know why we're getting a '\0' inside the name. I'm concerned about potential off by one errors somewhere in the UTF-16 <-> UTF-8 conversions on Windows (though I don't see any obvious places). https://codereview.chromium.org/1152283014/diff/1/src/pdf/SkPDFTypes.cpp File src/pdf/SkPDFTypes.cpp (right): https://codereview.chromium.org/1152283014/diff/1/src/pdf/SkPDFTypes.cpp#newc... src/pdf/SkPDFTypes.cpp:108: if ('\0' == *n) { If you're doing it this way, you should drop the 'len' parameter completely and re-write this to use '\0' as the terminator. If you keep 'len' then '\0' should be escaped. Since 'name' is coming from sources which claim to be utf-8, it's theoretically more correct to keep 'len' and escape '\0' properly.
https://codereview.chromium.org/1152283014/diff/1/src/pdf/SkPDFTypes.cpp File src/pdf/SkPDFTypes.cpp (right): https://codereview.chromium.org/1152283014/diff/1/src/pdf/SkPDFTypes.cpp#newc... src/pdf/SkPDFTypes.cpp:108: if ('\0' == *n) { On 2015/06/08 15:23:48, bungeman1 wrote: > If you're doing it this way, you should drop the 'len' parameter completely and > re-write this to use '\0' as the terminator. If you keep 'len' then '\0' should > be escaped. Since 'name' is coming from sources which claim to be utf-8, it's > theoretically more correct to keep 'len' and escape '\0' properly. Done.
The CQ bit was checked by halcanary@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1152283014/40001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/1152283014/diff/40001/src/pdf/SkPDFTypes.cpp File src/pdf/SkPDFTypes.cpp (right): https://codereview.chromium.org/1152283014/diff/40001/src/pdf/SkPDFTypes.cpp#... src/pdf/SkPDFTypes.cpp:102: // Given an arbitrary string, write it as a valid name (not includeing s/includeing/including https://codereview.chromium.org/1152283014/diff/40001/src/pdf/SkPDFTypes.cpp#... src/pdf/SkPDFTypes.cpp:108: *n; ++n) { We have 100 chars, this should go on the previous line.
Patchset #4 (id:60001) has been deleted
https://codereview.chromium.org/1152283014/diff/40001/src/pdf/SkPDFTypes.cpp File src/pdf/SkPDFTypes.cpp (right): https://codereview.chromium.org/1152283014/diff/40001/src/pdf/SkPDFTypes.cpp#... src/pdf/SkPDFTypes.cpp:102: // Given an arbitrary string, write it as a valid name (not includeing On 2015/06/08 17:18:23, bungeman1 wrote: > s/includeing/including Done. https://codereview.chromium.org/1152283014/diff/40001/src/pdf/SkPDFTypes.cpp#... src/pdf/SkPDFTypes.cpp:108: *n; ++n) { On 2015/06/08 17:18:23, bungeman1 wrote: > We have 100 chars, this should go on the previous line. Done.
lgtm
The CQ bit was checked by halcanary@google.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1152283014/80001
Message was sent while issue was closed.
Committed patchset #4 (id:80001) as https://skia.googlesource.com/skia/+/8ca89e18f54dcc9f18c17aff4d49791b310c4eeb |