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.
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.
#1 Best Overall
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.
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
fscanfprocesses 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 callsfprintf. 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)whenfopenfails.
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.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →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.
Quick Recap
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.




