Changeset 216049 in webkit


Ignore:
Timestamp:
May 1, 2017 6:00:35 PM (7 years ago)
Author:
ddkilzer@apple.com
Message:

Stop using sprintf() in JavaScriptCore debugger
<https://webkit.org/b/171512>

Reviewed by Keith Miller.

Source/JavaScriptCore:

  • disassembler/udis86/udis86.c:

(ud_insn_hex): Switch from sprintf() to snprintf().

Tools:

  • Scripts/webkitpy/style/checker.py:

(_PATH_RULES_SPECIFIER): Ignore some formatting checkers since
Source/JavaScriptCore/disassembler/udis86/ is generated code.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r216027 r216049  
     12017-05-01  David Kilzer  <ddkilzer@apple.com>
     2
     3        Stop using sprintf() in JavaScriptCore debugger
     4        <https://webkit.org/b/171512>
     5
     6        Reviewed by Keith Miller.
     7
     8        * disassembler/udis86/udis86.c:
     9        (ud_insn_hex): Switch from sprintf() to snprintf().
     10
    1112017-04-21  Filip Pizlo  <fpizlo@apple.com>
    212
  • trunk/Source/JavaScriptCore/disassembler/udis86/udis86.c

    r198832 r216049  
    168168    unsigned int i;
    169169    const unsigned char *src_ptr = ud_insn_ptr(u);
    170     char* src_hex;
    171     src_hex = (char*) u->insn_hexcode;
     170    char* src_hex = (char*) u->insn_hexcode;
     171    char* const src_hex_base = src_hex;
    172172    /* for each byte used to decode instruction */
    173173    for (i = 0; i < ud_insn_len(u) && i < sizeof(u->insn_hexcode) / 2;
    174174         ++i, ++src_ptr) {
    175       sprintf(src_hex, "%02x", *src_ptr & 0xFF);
     175      snprintf(src_hex, sizeof(u->insn_hexcode) - (src_hex - src_hex_base), "%02x", *src_ptr & 0xFF);
    176176      src_hex += 2;
    177177    }
  • trunk/Tools/ChangeLog

    r216047 r216049  
     12017-05-01  David Kilzer  <ddkilzer@apple.com>
     2
     3        Stop using sprintf() in JavaScriptCore debugger
     4        <https://webkit.org/b/171512>
     5
     6        Reviewed by Keith Miller.
     7
     8        * Scripts/webkitpy/style/checker.py:
     9        (_PATH_RULES_SPECIFIER): Ignore some formatting checkers since
     10        Source/JavaScriptCore/disassembler/udis86/ is generated code.
     11
    1122017-05-01  Timothy Horton  <timothy_horton@apple.com>
    213
  • trunk/Tools/Scripts/webkitpy/style/checker.py

    r214338 r216049  
    22# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
    33# Copyright (C) 2010 ProFUSION embedded systems
    4 # Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
     4# Copyright (C) 2013-2017 Apple Inc. All rights reserved.
    55#
    66# Redistribution and use in source and binary forms, with or without
     
    231231      "+pep8/W291",  # Trailing white space
    232232      "+whitespace/carriage_return"]),
     233
     234    ([# Source/JavaScriptCore/disassembler/udis86/ is generated code.
     235      os.path.join('Source', 'JavaScriptCore', 'disassembler', 'udis86')],
     236     ["-readability/naming/underscores",
     237      "-whitespace/declaration",
     238      "-whitespace/indent"]),
    233239
    234240    ([# There is no way to avoid the symbols __jit_debug_register_code
Note: See TracChangeset for help on using the changeset viewer.