Skip to content

Commit

Permalink
Quiet more sanitization errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Oct 3, 2018
1 parent 46605cc commit 41b0845
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions include/click/array_memory.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ template <size_t s> class sized_array_memory { public:
memcpy(a, x, s);
}
static void copy(void *dst, const void *src, size_t n) {
memcpy(dst, src, n * s);
if (n)
memcpy(dst, src, n * s);
}
static void move(void *dst, const void *src, size_t n) {
memmove(dst, src, n * s);
if (n)
memmove(dst, src, n * s);
}
static void move_onto(void *dst, const void *src, size_t n) {
memmove(dst, src, n * s);
if (n)
memmove(dst, src, n * s);
}
static void destroy(void *a, size_t n) {
(void) a, (void) n;
Expand Down
3 changes: 2 additions & 1 deletion lib/router.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,8 @@ Router::store_local_handler(int eindex, Handler &to_store)
for (int i = 0; i < HANDLER_BUFSIZ - 1; i++)
new_handler_buf[i]._next_by_name = _nhandlers_bufs + i + 1;
_free_handler = _nhandlers_bufs;
memcpy(new_handler_bufs, _handler_bufs, sizeof(Handler*) * n_handler_bufs);
if (n_handler_bufs)
memcpy(new_handler_bufs, _handler_bufs, sizeof(Handler*) * n_handler_bufs);
new_handler_bufs[n_handler_bufs] = new_handler_buf;
delete[] _handler_bufs;
_handler_bufs = new_handler_bufs;
Expand Down

0 comments on commit 41b0845

Please sign in to comment.