@@ -142,7 +142,7 @@ static xmlDocPtr strip_ns(xmlDocPtr doc)
142
142
return result ;
143
143
}
144
144
145
- static int process_file (const char * prefix , const char * path , const char * filename , struct pfdata * pfd )
145
+ static int process_file (const char * prefix , const char * path , const char * filename , struct pfdata * pfd , struct oscap_list * blocked_paths )
146
146
{
147
147
int ret = 0 , path_len , filename_len ;
148
148
char * whole_path = NULL ;
@@ -170,6 +170,10 @@ static int process_file(const char *prefix, const char *path, const char *filena
170
170
171
171
memcpy (whole_path + path_len , filename , filename_len + 1 );
172
172
173
+ if (probe_path_is_blocked (whole_path , blocked_paths )) {
174
+ goto cleanup ;
175
+ }
176
+
173
177
if (prefix == NULL ) {
174
178
doc = xmlParseFile (whole_path );
175
179
} else {
@@ -392,7 +396,7 @@ int xmlfilecontent_probe_main(probe_ctx *ctx, void *arg)
392
396
393
397
if ((ofts = oval_fts_open_prefixed (prefix , path_ent , filename_ent , filepath_ent , behaviors_ent , probe_ctx_getresult (ctx ))) != NULL ) {
394
398
while ((ofts_ent = oval_fts_read (ofts )) != NULL ) {
395
- process_file (prefix , ofts_ent -> path , ofts_ent -> file , & pfd );
399
+ process_file (prefix , ofts_ent -> path , ofts_ent -> file , & pfd , ctx -> blocked_paths );
396
400
oval_ftsent_free (ofts_ent );
397
401
}
398
402
0 commit comments