These functions include strcpy(3), strcat(3), sprintf(3) (with cousin vsprintf(3)), and gets(3).
这些函数包括strcpy(3)、strcat(3)、sprintf(3) (及其同类vsprintf(3) )和gets(3) 。
The strcpy function can be implemented using the "s" and "d" constraints in the following manner.
strcpy函数可以通过以下方式使用“s ”和“D ”约束来实现。
You also have to use the memalign function and strcpy to copy the data into an area of appropriate alignment.
另外,还需要使用memalign函数和strcpy 将数据复制到合适对齐的区域。
The correct way to do this would be to use the strncpy function instead of strcpy , and give the maximum number of bytes to copy as BUFSIZ - 1.
复制的正确方法是用strncpy函数代替strcpy,并将要复制的最大字节数定为BUFSIZ-1。
This means that switching from strcpy (3) to strncpy (3) can reduce performance — often not a serious problem on today's computers, but it can still be a nuisance.
这意味着从strcpy(3)切换到strncpy(3)会降低性能——这在如今的计算机上通常不是一个严重的问题,但它仍然是有害的。
Memcpy joins the ranks of other popular functions like strcpy, strncpy, strcat, strncat which were banned due to their security vulnerability through buffer overruns.
memcpy加入到strcpy,strncpy,strcat,strncat等常用函数的队伍中,都是由于可通过缓存溢出进行安全攻击而被禁用。
The function loads the file data using a single call to fread , copying the data into a separate structure, before using a strcpy to move the data from the loaded string to the global string.
此函数通过调用fread装载文件数据,把数据复制到另一个结构中,然后使用strcpy把数据从装载的字符串转移到全局字符串中。
Listing 1 does not validate user-supplied data when copying it to the buffer member of the previously allocated struct mystruct using the strcpy function, resulting in a heap-based buffer overflow.
在使用strcpy函数将用户提供的数据复制到先前分配的struct mystruct的buffer成员中时,清单1不验证用户提供的数据,造成堆中缓冲区溢出。
Listing 1 does not validate user-supplied data when copying it to the buffer member of the previously allocated struct mystruct using the strcpy function, resulting in a heap-based buffer overflow.
在使用strcpy函数将用户提供的数据复制到先前分配的struct mystruct的buffer成员中时,清单1不验证用户提供的数据,造成堆中缓冲区溢出。
应用推荐