[hackers] [quark] memcpy regions may not overlap, use memmove || Hiltjo Posthuma
commit fc9f02cee3c6cbb82c70fbf7285b73092004973f
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
AuthorDate: Wed Jul 5 19:06:04 2017 +0200
Commit: Laslo Hunhold <dev_AT_frign.de>
CommitDate: Wed Jul 5 19:34:25 2017 +0200
memcpy regions may not overlap, use memmove
for example a path: "/../../" made quark abort().
diff --git a/quark.c b/quark.c
index e3c3058..84b358b 100644
--- a/quark.c
+++ b/quark.c
_AT_@ -531,7 +531,7 @@ squash:
*p = '\0';
len = p - path;
} else {
- memcpy(p, q + 1, len - ((q + 1) - path) + 2);
+ memmove(p, q + 1, len - ((q + 1) - path) + 2);
len -= (q + 1) - p;
}
}
Received on Wed Jul 05 2017 - 19:34:28 CEST
This archive was generated by hypermail 2.3.0
: Wed Jul 05 2017 - 19:37:04 CEST