Replace few instances of memcmp/memcpy in the code that should be grub_memcmp/grub_memcpy.

This commit is contained in:
Vladimir Serbinenko 2014-04-04 07:58:42 +02:00
parent 9706066791
commit 8063ce197f
5 changed files with 12 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2014-04-04 Vladimir Serbinenko <phcoder@gmail.com>
Replace few instances of memcmp/memcpy in the code that should be
grub_memcmp/grub_memcpy.
2014-04-03 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Support NVMe

View File

@ -214,8 +214,8 @@ get_sleep_type (grub_uint8_t *table, grub_uint8_t *ptr, grub_uint8_t *end,
}
case GRUB_ACPI_OPCODE_NAME:
ptr++;
if ((!scope || memcmp (scope, "\\", scope_len) == 0) &&
(memcmp (ptr, "_S5_", 4) == 0 || memcmp (ptr, "\\_S5_", 4) == 0))
if ((!scope || grub_memcmp (scope, "\\", scope_len) == 0) &&
(grub_memcmp (ptr, "_S5_", 4) == 0 || grub_memcmp (ptr, "\\_S5_", 4) == 0))
{
int ll;
grub_uint8_t *ptr2 = ptr;

View File

@ -580,7 +580,7 @@ check_password_md5_real (const char *entered,
GRUB_MD_MD5->write (ctx, entered, enteredlen);
digest = GRUB_MD_MD5->read (ctx);
GRUB_MD_MD5->final (ctx);
memcpy (alt_result, digest, MD5_HASHLEN);
grub_memcpy (alt_result, digest, MD5_HASHLEN);
GRUB_MD_MD5->init (ctx);
GRUB_MD_MD5->write (ctx, entered, enteredlen);
@ -596,7 +596,7 @@ check_password_md5_real (const char *entered,
for (i = 0; i < 1000; i++)
{
memcpy (alt_result, digest, 16);
grub_memcpy (alt_result, digest, 16);
GRUB_MD_MD5->init (ctx);
if ((i & 1) != 0)

View File

@ -652,7 +652,7 @@ malloc_in_range (struct grub_relocator *rel,
for (i = 0; i < (BITS_IN_BYTE * sizeof (grub_addr_t) / DIGITSORT_BITS);
i++)
{
memset (counter, 0, (1 + (1 << DIGITSORT_BITS)) * sizeof (counter[0]));
grub_memset (counter, 0, (1 + (1 << DIGITSORT_BITS)) * sizeof (counter[0]));
for (j = 0; j < N; j++)
counter[((events[j].pos >> (DIGITSORT_BITS * i))
& DIGITSORT_MASK) + 1]++;

View File

@ -1082,7 +1082,7 @@ grub_netbsd_add_boot_disk_and_wedge (void)
grub_crypto_hash (GRUB_MD_MD5, hash,
buf.raw, GRUB_DISK_SECTOR_SIZE);
memcpy (biw.matchhash, hash, 16);
grub_memcpy (biw.matchhash, hash, 16);
grub_bsd_add_meta (NETBSD_BTINFO_BOOTWEDGE, &biw, sizeof (biw));
}
@ -1100,7 +1100,7 @@ grub_netbsd_add_boot_disk_and_wedge (void)
bid.labelsector = partmapsector;
bid.label.type = buf.label.type;
bid.label.checksum = buf.label.checksum;
memcpy (bid.label.packname, buf.label.packname, 16);
grub_memcpy (bid.label.packname, buf.label.packname, 16);
}
else
{