Elektrine lite

← Feed

@ska@social.treehouse.systems

2026-09-23 11:41 UTC

@david_chisnall@infosec.exchange Indeed, I always tend to forget that argv is mutable, because mutating it is another code smell 😅

Replies (1)

  • @ska@social.treehouse.systems The worst one is environ because setenv actively mutates it and means that any pointer retrieved by getenv and any traversal of environ may dereference a dangling pointer in any POSIX-compliant implementation if setenv is every called, especially in a multithreaded program. My general rule for setenv is never call it. The experts-only version is call it in main before calling any other function in another compilation unit.

    Open ##4818390