[Patch] multibyte encodings in strings

Nick Clifton nickc@redhat.com
Fri Nov 9 12:49:00 GMT 2018


Hi Mathias,

> I am sending you a patch fixing an issue in the binary 'strings'.
> The issue concerned finding multibyte encoded strings at odd offsets.

Thanks for the bug report and the patch.

I have decided to consider the patch as "obvious", in the sense that
it does not need an FSF copyright assignment, although I would still
encourage you to apply for such an assignment should you want to 
contribute further patches.

I have applied the patch along with a couple of extra updates.  
Specifically I have created a ChangeLog entry for the patch, and a 
new test in the binutils testsuite in order to make sure that the
patch continues to work.

There is one issue however that I would like to check with you.
The original (unpatched) decoding of the test binary that you
supplied produces the output: "String2" whereas the patched
version of string produces: "String1" and "tring2".  Is this
correct ?  I was kind of expecting the output to be "String1"
and "String2".

Cheers
  Nick

binutils/ChangeLog
2018-11-09  Mathias   <m4tze@exitno.de>

	* strings.c (print_strings): Check for multibyte encodings.
	* binutils-all/strings-1.bin: New file.  Test binary for string decoding.
	* testsuite/binutils-all/strings.exp: New file.  Test the strings program.
	* testsuite/config/default.exp (STRINGS): Define if not provided
	by the environment.
	(STRINGSFLAGS): Likewise.



More information about the Binutils mailing list