issue #2870: fix bug for compare the magic bytes