From 1170475966c09e71a2cd770bc53b15fa70dcf582 Mon Sep 17 00:00:00 2001
From: Ville Valkonen <weezel@users.noreply.github.com>
Date: Mon, 6 Mar 2023 01:11:19 +0200
Subject: [PATCH 01/10] Fix implicit memory aliasing in a loop. (#406)
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

Otherwise the code will point into the same memory address during the
loop.

Signed-off-by: Ville Valkonen <weezelding@gmail.com>
Co-authored-by: Tim Zabel <Tjzabel21@gmail.com>
Signed-off-by: Alexander Miroshnichenko <alex@millerson.name>
---
 internal/handlers/telegram/handler.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/internal/handlers/telegram/handler.go b/internal/handlers/telegram/handler.go
index 5921d6794ebb..12404273adf4 100644
--- a/internal/handlers/telegram/handler.go
+++ b/internal/handlers/telegram/handler.go
@@ -120,6 +120,7 @@ joinHandler handles when users join the Telegram group
 func joinHandler(tg *Client, users *[]tgbotapi.User) {
 	if tg.IRCSettings.ShowJoinMessage {
 		for _, user := range *users {
+			user := user
 			username := GetFullUsername(tg.IRCSettings.ShowZWSP, &user)
 			formatted := username + " has joined the Telegram Group!"
 			tg.sendToIrc(formatted)
-- 
2.41.0

