Author: oshogbo
Date: Thu Mar 21 06:31:14 2019
New Revision: 345364
URL: https://svnweb.freebsd.org/changeset/base/345364

Log:
  In case of ENCODING_8BIT the EOF code will be pass to putchar.
  EOF check should be done before (uint8_t)c > 127 test.
  
  Reported by:  cem

Modified:
  head/contrib/elftoolchain/strings/strings.c

Modified: head/contrib/elftoolchain/strings/strings.c
==============================================================================
--- head/contrib/elftoolchain/strings/strings.c Thu Mar 21 06:27:58 2019        
(r345363)
+++ head/contrib/elftoolchain/strings/strings.c Thu Mar 21 06:31:14 2019        
(r345364)
@@ -402,13 +402,13 @@ find_strings(const char *name, FILE *pfile, off_t offs
                                        break;
                                c = getcharacter(pfile);
                                cur_off += encoding_size;
+                               if (!PRINTABLE(c) || c == EOF)
+                                       break;
                                if (encoding == ENCODING_8BIT &&
                                    (uint8_t)c > 127) {
                                        putchar(c);
                                        continue;
                                }
-                               if (!PRINTABLE(c) || c == EOF)
-                                       break;
                                putchar(c);
                        }
                        putchar('\n');
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to