Intel® Inspector User Guide for Linux* OS

ID 767796
Date 5/15/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents
Give Feedback

Incorrect memcpy Call

Occurs when an application calls the memcpy function with two pointers that overlap within the range to be copied. This condition is only checked on Linux* systems. On Windows* systems, this function is safe for overlapping memory.

ID

Code Location

Description

1

Call site

Represents the location from which the memcpy function was called.

Example

char *p = (char *)malloc(10);
memcpy(p+3, p, 5);

NOTE:
Linux* operating system/GNU gcc* compiler: The Intel Inspector cannot check for inlined calls to memcpy. Specify -fno-builtin to prevent inlining and allow the Intel Inspector to check for arguments.

Possible Correction Strategies

If the arguments represent the range you want to copy, call the memmove function instead of the memcpy function.