From: nicm Date: Sat, 12 Oct 2024 08:13:52 +0000 (+0000) Subject: Do not rename a buffer to itself, GitHub issue 4181. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=232cb8cb3a0aa3add13488f1ce41de70485545ef;p=openbsd Do not rename a buffer to itself, GitHub issue 4181. --- diff --git a/usr.bin/tmux/paste.c b/usr.bin/tmux/paste.c index 27f61a1b29c..f7993ff8a55 100644 --- a/usr.bin/tmux/paste.c +++ b/usr.bin/tmux/paste.c @@ -1,4 +1,4 @@ -/* $OpenBSD: paste.c,v 1.46 2023/02/07 10:56:04 nicm Exp $ */ +/* $OpenBSD: paste.c,v 1.47 2024/10/12 08:13:52 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -241,6 +241,8 @@ paste_rename(const char *oldname, const char *newname, char **cause) } pb_new = paste_get_name(newname); + if (pb_new == pb) + return (0); if (pb_new != NULL) paste_free(pb_new);