From 9ec94aa982692ba2c06bc7d89994459615ccd740 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 20 Mar 2022 17:58:14 -0700 Subject: disallow all relative paths (./ or ../) Teliva's model doesn't include any way to change directory. We just have relative paths and absolute paths. Relative paths should not be able to reach into parent directories. The current test is a bit hacky; it also disallows directories ending in a period. Hopefully not an issue. --- src/teliva.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/teliva.h') diff --git a/src/teliva.h b/src/teliva.h index 6777240..7455cfc 100644 --- a/src/teliva.h +++ b/src/teliva.h @@ -189,5 +189,6 @@ extern void render_previous_error(void); /* Misc */ extern int starts_with(const char* s, const char* prefix); +extern int contains(const char* s, const char* sub); #endif -- cgit 1.4.1-2-gfad0