* Use memmove where needed (thanks @earada for the patch)
- Fixes probably segfaults in latest GLIBC
This commit is contained in:
parent
421208a0c7
commit
eb3de0a3f4
|
@ -118,7 +118,7 @@ static int check(RBinArch *arch) {
|
|||
memcpy (&off, arch->buf->buf+4*sizeof(int), sizeof(int));
|
||||
r_mem_copyendian ((ut8*)&off, (ut8*)&off, sizeof(int), !LIL_ENDIAN);
|
||||
if (off > 0 && off < arch->buf->length) {
|
||||
memcpy (arch->buf->buf, arch->buf->buf+off, 4);
|
||||
memmove (arch->buf->buf, arch->buf->buf+off, 4);
|
||||
if (!memcmp (arch->buf->buf, "\xce\xfa\xed\xfe", 4) ||
|
||||
!memcmp (arch->buf->buf, "\xfe\xed\xfa\xce", 4) ||
|
||||
!memcmp (arch->buf->buf, "\xfe\xed\xfa\xcf", 4) ||
|
||||
|
|
|
@ -408,7 +408,7 @@ R_API char *r_line_readline() {
|
|||
if (I.buffer.index < I.buffer.length) {
|
||||
if (I.buffer.index>0) {
|
||||
I.buffer.index--;
|
||||
memcpy (I.buffer.data+I.buffer.index,
|
||||
memmove (I.buffer.data+I.buffer.index,
|
||||
I.buffer.data+I.buffer.index+1,
|
||||
strlen (I.buffer.data+I.buffer.index));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue