Skip to content

Commit

Permalink
Merge pull request gphoto#171 from axxel/log_remove_func-fix
Browse files Browse the repository at this point in the history
fix memory corruption in gp_log_remove_func
  • Loading branch information
msmeissn authored Jun 3, 2017
2 parents 8b14ec1 + db56a3b commit 03e85f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libgphoto2_port/libgphoto2_port/gphoto2-port-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ gp_log_remove_func (int id)

for (i=0;i<log_funcs_count;i++) {
if (log_funcs[i].id == id) {
memmove (log_funcs + i - 1, log_funcs + i, log_funcs_count - i);
memmove (log_funcs + i, log_funcs + i + 1, sizeof(LogFunc) * (log_funcs_count - i - 1));
log_funcs_count--;
return GP_OK;
}
Expand Down

0 comments on commit 03e85f9

Please sign in to comment.