October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

13 C Project Issues, Led by a Login Check That Never Blocked Admin Access

An audit of a local C campus guide reports 13 issues. Its headline security flaw: the caller ignores the login result and opens the manager panel anyway.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Roman Huang’s audit of a local C campus-tour guide reports 13 issues, including a login flow that could open the manager panel after a wrong password. The key flaw was not that the login function failed to check credentials: it was that the caller ignored the function’s result and continued into the privileged operation. Huang’s account describes a console program with no networking; the findings below are his reported analysis, not an independent security review or reproduction.

What the C graph project does

Huang describes a console-based campus guide that presents 12 locations connected by a weighted, undirected graph. It uses an adjacency matrix, computes all-pairs shortest paths with Floyd–Warshall at startup, and uses depth-first search (DFS) to find paths between two locations. The audit reports 13 issues across the program, its input handling, and its Visual Studio project setup.

As an Amazon Associate I earn from qualifying purchases.

How a wrong password could still reach the manager

In Huang’s account, Login() returns 1 when credentials are valid. But the caller discards that return value and invokes Manager() unconditionally. As a result, the login check does not gate access: a user entering the wrong password can still reach the manager panel, which the article describes as full admin access.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This is a control-flow failure. A credential-checking function can report failure correctly and still provide no protection if the code that calls it does not enforce the result. The call site needs to make entry into the privileged function conditional on successful authentication, for example by calling Manager() only when Login() succeeds.

Failed-login recursion adds another risk

Huang also reports that a failed login causes the function to call itself recursively, while discarding the recursive call’s result. Repeated failures can therefore grow the call stack and, after enough attempts, may cause a stack overflow. That is the article’s analysis, not a result of a reported independent run.

A bounded loop with an attempt counter and an explicit failure return is a safer retry structure: each failure consumes a defined attempt rather than adding another function call to the stack. The caller can then deny access when the login routine returns failure.

Input and expression defects in the code

Unbounded input into a fixed-size name field

The article shows a char name[20] field filled using fscanf with %s and no width limit. A string longer than the available buffer can overrun it. In Huang’s example, a UTF-8 Chinese location name occupies 24 bytes, so character count alone does not establish that the text fits: UTF-8 characters can require multiple bytes. The reported overwrite could extend into the following struct member.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Huang recommends sizing the buffer for expected input and bounding the conversion, giving %63s as an example for a suitably sized destination. A width limit must leave room for the terminating null byte; the width and buffer size need to agree.

Modifying and reading values in one printf call

Another reported defect decrements sNum and eNum in arguments to printf while also using them to index dist in that same call. Huang says GCC warns about sequence-point or ordering concerns. The straightforward remedy is to decrement the variables on separate lines before calling printf, so the indices and printed values are determined before the function arguments are evaluated.

Other reported project and file-handling issues

  • Broken Visual Studio references: After a rename, the solution, project, and source-file reference chain reportedly no longer matched, leaving the project unable to open in Visual Studio as-is.
  • Unexpected input-file iteration: Huang reports that fscanf processes 18 iterations even though the file contains 16 edges, duplicating the final edge on the last two iterations.
  • Writing through a read-only stream: The announcement feature reportedly opens a file with mode "r" and then calls fprintf. The write fails, but the program reports success.
  • Hardcoded input limit: The program reportedly uses a limit of 12 rather than deriving the limit from the graph’s vertex count.
  • Closing a null stream: Huang identifies a path that calls fclose(NULL) when fopen fails.

These examples point to distinct checks: confirm project paths after renames, validate how file-reading loops detect records and end-of-file, open streams in a mode appropriate to the operation, derive limits from the data structure, and check a file pointer before using or closing it. Huang also recommends enabling compiler warnings.

What the audit says about the graph algorithms

Huang describes the Floyd–Warshall path reconstruction as using a path[i][j] intermediate-node table. He also characterizes the DFS path search as using backtracking to reset visited nodes, and considers these parts well structured, while noting a small quirk in path-length accumulation. These are the author’s assessments; the available account does not establish independent validation of the implementation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Scope of the reported findings

The audit concerns a local console application with no networking. Its login flaw illustrates why authentication must be enforced at the point where privileged code is called, but the account does not establish that the project was deployed, remotely exploitable, or independently reproduced. The article’s search result showed a posting date of “Sep 24” without establishing the year, so no publication year is assigned here.

Best Value

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.