Zum Hauptinhalt springen
LIVE
CVSS 4.8CVE-2026-138092 | A security flaw has been discovered in ggml-org llama.cpp up to 0.8.0. This vulnerability affects the function ggml_roll of the file ggml/src/ggml.c of the component Ggml Tensor Library Roll Operation. The manipulation results in integer overflow. The attack needs to be approached locally. Upgrading to version 0.9.0 is able to resolve this issue. The patch is identified as 0978a6e9022fb9bd6874b86154ee304e81929b9f. It is suggested to upgrade the affected compCVSS 10.0CVE-2026-138091 | A vulnerability was identified in Tenda AC10U 15.03.06.48. This affects the function TendaTelnet of the file /goform/telnet of the component Web UI. The manipulation leads to missing authentication. The attack is possible to be carried out remotely. The exploit is publicly available and might be used.CVSS 10.0CVE-2026-138090 | A vulnerability was determined in Tenda AC10U 15.03.06.48. Affected by this issue is the function ate_ifconfig_set of the file /bin/httpd of the component ATE Service. Executing a manipulation can lead to os command injection. The attack can be executed remotely. The exploit has been publicly disclosed and may be utilized.CVSS 6.9CVE-2026-138089 | A vulnerability was found in Youzan ZanProxy up to 5.1.0. Affected by this vulnerability is the function processRedirect of the file src/core/proxy/middleware/rule.ts of the component Forwarding Rule Redirect. Performing a manipulation of the argument Target results in path traversal. Remote exploitation of the attack is possible. The exploit has been made public and could be used. The project was informed of the problem early through an issue report but hasCVSS 6.9CVE-2026-138088 | A vulnerability has been found in SchneeHertz exhentai-manga-manager up to 1.6.16. Affected is the function mangaToLANraragiArchive of the file index.js of the component LAN Browsing Service. Such manipulation leads to missing authentication. The attack may be launched remotely. The exploit has been disclosed to the public and may be used. The reported GitHub issue was closed with the reason "completed". However, it was not possible to determine the PR or coCVSS 6.9CVE-2026-138087 | A flaw has been found in linhaojun857 aurora up to 07e9524caacf6ceb021f3408e73f900f230d05f2. This impacts the function generalKey of the file aurora-springboot/src/main/resources/application-prod.yml of the component JWT Token Service. This manipulation of the argument secret causes use of hard-coded cryptographic key . The attack may be initiated remotely. The exploit has been published and may be used. This product uses a rolling release model to deliverCVSS 6.9CVE-2026-138086 | A security vulnerability has been detected in wonderunit storyboarder 3.0.0. The impacted element is the function MobileServer of the file src/js/express-app/app.js. The manipulation leads to missing authentication. The attack can be initiated remotely. The exploit has been disclosed publicly and may be used. The project was informed of the problem early through an issue report but has not responded yet.CVSS 5.3CVE-2026-138085 | A weakness has been identified in ThingsBoard up to 4.2.2.7/4.3.1.7/4.4.0. The affected element is the function downloadTestReport of the file application/src/main/java/org/thingsboard/server/controller/DashboardReportController.java of the component Report Service. Executing a manipulation of the argument userId can lead to authorization bypass. It is possible to launch the attack remotely. The exploit has been made available to the public and could be used
Alle im Drawer
Intelligence View
⚡ tsecurity.de Intelligence

Variable Scope and Variable Shadowing in Golang

Variable scope refers to the block or region of code in which a variable can be accessed. Go uses lexical scoping (also known as static scoping) based on…

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Quelle & Fakten · 3 Min. Lesezeit
Quelle: dev.to
Rubrik: Sichere Programmierung

Variable scope refers to the block or region of code in which a variable can be accessed. Go uses lexical scoping (also known as static scoping) based on blocks.



A block is a sequence of declarations and statements enclosed within matching curly braces {}.



Let's consider the following Go code:




package main

import "fmt"

func main() {
var x int = 5

if true {
x := 15
fmt.Println("Value of x at stage 1:", x)

x = 20
fmt.Println("Value of x at stage 2:", x)
}

fmt.Println("Value of x at stage 3:", x)
}






What do you think the output of this code will be? Let's evaluate it.



The line x := 15 declares a new variable within the scope of the if block. So, whenever x is modified inside that block, the changes apply only to the inner x, not to the outer one.



Therefore, the output will be:




Value of x at stage 1: 15
Value of x at stage 2: 20
Value of x at stage 3: 5






This behavior is called variable shadowing. It occurs when a variable declared in an inner scope has the same name as a variable declared in an outer scope.



When you write x := 15, you are not assigning a new value to the x whose value is 5. Instead, you are declaring a completely new and distinct variable that just happens to have the same name. Go allocates separate memory for this inner x.



From that point until the closing brace } of the if block, the inner x shadows (or hides) the outer x. Whenever the Go compiler encounters x inside that block, it resolves it to the variable in the innermost scope.



Here's what happens at each stage:





  • Stage 1: A new variable x is initialized with the value 15. The outer x (which is 5) still exists, but it is temporarily hidden.


  • Stage 2: The statement x = 20 updates the inner x. The outer x remains unchanged.


  • Stage 3: The if block ends, so the inner x goes out of scope. The name x now refers to the outer variable again, which still holds the value 5.



One simple way to avoid this issue is to choose variable names carefully so that shadowing doesn't happen unintentionally.



Variable shadowing is a common source of subtle bugs in Go, especially when working with multiple return values. A frequent example is accidentally shadowing the err variable inside loops or conditional blocks by using := instead of =.



Have you ever run into a bug caused by variable shadowing in Go? Share your experience in the comments!

Information ergänzen Fachhinweis, Update, Korrektur oder Quelle zur Meldung beitragen
Gäste-Hinweise werden kurz redaktionell geprüft und danach hier angezeigt.

Community-Hinweise zur Meldung

0 freigegeben
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!
Informations-Bewertung:

💬 Topluluk tartışması ve yorumlar

🌐 Ana sohbete katıl

Tartışmayı başlat: Social Chat yayın akışı veya yukarıdaki ekleme formuyla uzman katkısı gönder.

Community Rating & Social Proof
⭐ Okuyucu Puanı
–
Ø / 5.0
Hiçbir okuyucu henüz yorum yok
Bu makale yararlı mıydı?
0
Değerlendirmenizi gönderin
Detaylı değerlendirme (isteğe bağlı)
İçerik ve Kalite
Kaynak ve Güvenilirlik
Güncellik
Security Briefing Ücretsiz · Tek tıkla abonelikten çıkma

Zeka Digest - ücretsiz

Günlük en önemli güvenlik haberi · herhangi bir zamanda alınabilir

İlgili Story Cluster & Kaynaklar (vector AI)

1 Cluster
2 Kaynaklar
Samsung zieht eigener App am 31. März 2027 den Stecker
Giga.de 10 saat önce
1 başka bir kaynak
Benzer katkılar
🔍 Verwandte News

Auch interessante Nachrichten Variable Scope and Variable Shadowing in Golang

Thematisch verwandte Begriffe: Variable, Scope, Shadowing, Golang · 6 Treffer

Laden...

Videolar yükleniyor...

Laden...

Contributions yüklenir ...

Laden...

Videolar yükleniyor...

Laden...

Contributions yüklenir ...

Laden...

Videolar yükleniyor...

Laden...

Contributions yüklenir ...

Laden...

Videolar yükleniyor...

Laden...

Contributions yüklenir ...

Laden...

Videolar yükleniyor...

Yorumlar yüklenir..
Update to Update
Widgets & Topics
Loading widgets…
Nächster Beitrag