PSCAN(1)

πŸ“¦
version 1.3 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– PSCAN(1) πŸ’–

okay bestie, gather round, because this is the manual page for pscan and she is serving General Commands Manual energy. no cap. πŸŽ€


✨ NAME ✨

pscan β€” a format string security checker for C source code πŸ¦‹

like, she reads your C and she sniffs out format string crimes. that's the whole gig.


🌸 SYNOPSIS 🌸

pscan [options]

that's it. that's the whole summoning ritual. just pscan and whatever options you're feeling. πŸ’…


πŸ‘‘ DESCRIPTION πŸ‘‘

so pscan is a source code analysis tool, and her whole purpose in life is to highlight potentially dangerous uses of variadic functions β€” you know the ones, printf, syslog, etc. 😭 the ones that take a format string and then a whole lil swarm of extra args.

the way the scan works is she goes looking for one of a list of problem functions, and then she applies THE RULE:

IF the last parameter of the function is the format string, AND the format string is NOT a static string, THEN complain.

that's it. that's the vibe check. last param = format string and it's not static? she's gonna say something. periodt. πŸ’€


🫢 LIMITATIONS 🫢

okay so real talk, she is not gonna report on some potential buffer overflows, because honestly that is not her goal. she's not trying to do everything, she's trying to do this. main character with a very specific niche. ✨

for example, the following code is potentially dangerous:

sprintf(static_buffer,  %s/.foorc", getenv("HOME"));"

this code could cause an issue as there is no immediately obvious bounds checking. πŸ™ˆ but β€” and here's the plot twist β€” this is a safe usage with regards to format strings. so pscan is gonna look the other way. she said "not my department bestie." πŸ’…


⭐ RETURN VALUES ⭐

if there are any errors found, pscan exits with status 1.

so like, exit code 1 = she found something. she's not being dramatic, she's being accurate. πŸ”₯


πŸ’œ AUTHOR πŸ’œ

Alan DeKok <aland@ox.org>

iconic. legendary. we stan. πŸ‘‘


and that's the whole page, bestie β€” this came to you from the General Commands Manual corner of the world, filed under PSCAN(1), and it's giving timeless. go scan something. πŸ¦‹πŸ’–