From 1b83ee86dc775a9d7972d94041e226893983b264 Mon Sep 17 00:00:00 2001 From: Chris Liddell Date: Thu, 20 Jun 2019 12:24:04 +0100 Subject: File access control: handle non-null terminated paths Add an access control checking API call that can take a non-null terminated string (i.e. takes a string and length). The reason being the strings returned from gp_enumerate_files* are not null terminated, and we need to filter them by permissions. --- base/gp.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'base/gp.h') diff --git a/base/gp.h b/base/gp.h index b4b334c5f..3cd31c930 100644 --- a/base/gp.h +++ b/base/gp.h @@ -683,6 +683,12 @@ gp_local_arg_encoding_get_codepoint(gp_file *file, const char **astr); int gp_xpsprint(char *filename, char *printername, int *result); +int +gp_validate_path_len(const gs_memory_t *mem, + const char *path, + const uint rlen, + const char *mode); + int gp_validate_path(const gs_memory_t *mem, const char *path, -- cgit v1.2.1