summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJasper Lievisse Adriaanse <jasper@humppa.nl>2016-01-03 21:20:24 +0100
committerJasper Lievisse Adriaanse <jasper@humppa.nl>2016-01-03 21:20:24 +0100
commitb2bc07e51dbd2fd0f8455c73759ef5db8c2af746 (patch)
treef883611962468bcb8fb0d49a5c24b2481d4d0c02
parent96724356e1b7ea724ca999f4dabbe4e9d5948b36 (diff)
Fix a crash due to overlapping arguments of memcpy(3).
As the use of memcpy(3) on overlapping memory regions is strictly undefined, OpenBSD's memcpy(3) triggers an abort in such cases.
-rw-r--r--source/rofi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/rofi.c b/source/rofi.c
index 0c6f388c..b830114a 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -940,7 +940,7 @@ static void menu_refilter ( MenuState *state )
g_mutex_clear ( &mutex );
for ( unsigned int i = 0; i < nt; i++ ) {
if ( j != states[i].start ) {
- memcpy ( &( state->line_map[j] ), &( state->line_map[states[i].start] ), sizeof ( unsigned int ) * ( states[i].count ) );
+ memmove ( &( state->line_map[j] ), &( state->line_map[states[i].start] ), sizeof ( unsigned int ) * ( states[i].count ) );
}
j += states[i].count;
}