aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/dtc/util.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2016-01-26 10:04:11 -0500
committerRob Herring <robh@kernel.org>2016-02-11 20:45:09 -0500
commit91feabc2e2240ee80dc8ac08103cb83f497e4d12 (patch)
tree8bd53e02910f0d15b3516d7af298b03b19ca5dac /scripts/dtc/util.c
parent76df69806b7fafea013e2f4f82b0bd54498f3406 (diff)
scripts/dtc: Update to upstream commit b06e55c88b9b
Sync to upstream dtc commit b06e55c88b9b ("Prevent crash on modulo by zero"). This adds the following commits from upstream: b06e55c Prevent crash on modulo by zero b433450 Fix some bugs in processing of line directives d728ad5 Fix crash on nul character in string escape sequence 1ab2205 Gracefully handle bad octal literals 1937095 Prevent crash on division by zero d0b3ab0 libfdt: Fix undefined behaviour in fdt_offset_ptr() d4c7c25 libfdt: check for potential overrun in _fdt_splice() f58799b libfdt: Add some missing symbols to version.lds af9f26d Remove duplicated -Werror in dtc Makefile 604e61e fdt: Add functions to retrieve strings 8702bd1 fdt: Add a function to get the index of a string 2218387 fdt: Add a function to count strings 554fde2 libfdt: fix comment block of fdt_get_property_namelen() e5e6df7 fdtdump: Fix bug printing bytestrings with negative values 067829e Remove redundant fdtdump test code 897a429 Move fdt_path_offset alias tests to right tests section 2d1417c Add simple .travis.yml f6dbc6c guess output file format 5e78dff guess input file format based on file content or file name 8b927bf tests: convert `echo -n` to `printf` 64c46b0 Fix crash with poorly defined #size-cells Cc: Grant Likely <grant.likely@linaro.org> Tested-by: Frank Rowand <frank.rowand@sonymobile.com> Reviewed-by: Frank Rowand <frank.rowand@sonymobile.com> Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'scripts/dtc/util.c')
-rw-r--r--scripts/dtc/util.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/scripts/dtc/util.c b/scripts/dtc/util.c
index 9d65226df9e4..fb124eea4919 100644
--- a/scripts/dtc/util.c
+++ b/scripts/dtc/util.c
@@ -152,7 +152,6 @@ char get_escape_char(const char *s, int *i)
152 int j = *i + 1; 152 int j = *i + 1;
153 char val; 153 char val;
154 154
155 assert(c);
156 switch (c) { 155 switch (c) {
157 case 'a': 156 case 'a':
158 val = '\a'; 157 val = '\a';
@@ -349,7 +348,6 @@ int utilfdt_decode_type(const char *fmt, int *type, int *size)
349void utilfdt_print_data(const char *data, int len) 348void utilfdt_print_data(const char *data, int len)
350{ 349{
351 int i; 350 int i;
352 const char *p = data;
353 const char *s; 351 const char *s;
354 352
355 /* no data, don't print */ 353 /* no data, don't print */
@@ -376,6 +374,7 @@ void utilfdt_print_data(const char *data, int len)
376 i < (len - 1) ? " " : ""); 374 i < (len - 1) ? " " : "");
377 printf(">"); 375 printf(">");
378 } else { 376 } else {
377 const unsigned char *p = (const unsigned char *)data;
379 printf(" = ["); 378 printf(" = [");
380 for (i = 0; i < len; i++) 379 for (i = 0; i < len; i++)
381 printf("%02x%s", *p++, i < len - 1 ? " " : ""); 380 printf("%02x%s", *p++, i < len - 1 ? " " : "");