Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungI audited my own ML linter and had to withdraw its best evidence(21.09.2026 um 22:54 Uhr)
Sichere ProgrammierungQuantum Result Validation for Distributed Computing Systems(21.09.2026 um 22:54 Uhr)
Sichere ProgrammierungJWT Authentication and Role-Based Access Control in LocalHands(21.09.2026 um 22:56 Uhr)
Sichere ProgrammierungStochastic Parrot or Alien Mind?(21.09.2026 um 22:56 Uhr)
Sichere ProgrammierungBuilding AI for the Physical World Is a Different Engineering Problem(21.09.2026 um 22:58 Uhr)
Sichere ProgrammierungI audited my own ML linter and had to withdraw its best evidence(21.09.2026 um 22:54 Uhr)
Sichere ProgrammierungQuantum Result Validation for Distributed Computing Systems(21.09.2026 um 22:54 Uhr)
Sichere ProgrammierungJWT Authentication and Role-Based Access Control in LocalHands(21.09.2026 um 22:56 Uhr)
Sichere ProgrammierungStochastic Parrot or Alien Mind?(21.09.2026 um 22:56 Uhr)
Sichere ProgrammierungBuilding AI for the Physical World Is a Different Engineering Problem(21.09.2026 um 22:58 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

CodeSOD: Vestigial Organs

Matt inherited some C# code that reads from a JSON config file. public ServerJsonLoader(string configFile) { using (StreamReader reader = File.OpenText(configFile)) { JObject config = ... //snip if (config.GetValue("inputs") !=…

0
↗ Quelle (thedailywtf.com)
Reagiere als Erste:r — dein Feedback zählt!

Matt inherited some C# code that reads from a JSON config file.


public ServerJsonLoader(string configFile)
{
using (StreamReader reader = File.OpenText(configFile))
{
JObject config = ... //snip

if (config.GetValue("inputs") != null)
{
this.mixedConfig = config;

//Inputs
var inputs = ... //snip

//Outputs
if (config.GetValue("outputs") != null)
{
var outputs = ... //snip
}
}
else
{
if(config.GetValue("inputs") != null)
this.serverConfig = config;

if (config.GetValue("outputs") != null)
this.clientConfig = config;

}
}
}

We open the file as a stream, and then hand it off to a JObject, which handles the parsing for us. Then, if it has a value "inputs", we store the config as mixedConfig, and handle the inputs. Then, if it also has "outputs", we also process the outputs.


If we don't have an "inputs", we go down the else path, where we check: if we have "inputs", we store the config in serverConfig, and if we have "outputs", we store the config in clientConfig.


It pains me to say that this convoluted logic isn't useless. It may not even be wrong. In the case where there are no "inputs", but there are "outputs", we'll store the config in clientConfig.


What we have here is a terrible way to write a simple concept: if we have only outputs, we must be a client. I suspect that they once wanted it to also be true that if you had only inputs, you were a server. And if you had both, you were "mixed". Then, something changed about their rules or their config, and the server-only configuration became a little vestigial branch off this chain of ifs, never to be executed again.




[Advertisement]
ProGet’s got you covered with security and access controls on your NuGet feeds. Learn more.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten CodeSOD: Vestigial Organs

Thematisch verwandte Begriffe: CodeSOD, Vestigial, Organs · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-79918 | MaxKB is an open-source AI assistant for enterprise. Prior to version 2.…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick