Skip to content
Snippets Groups Projects
Commit d2378ab5 authored by Daniel Engberg's avatar Daniel Engberg
Browse files

audio/vorbis-tools: Add patch for CVE-2023-43361

parent 3308e620
No related branches found
No related tags found
No related merge requests found
PORTNAME= vorbis-tools
PORTVERSION= 1.4.2
PORTREVISION= 3
DISTVERSION= 1.4.2
PORTREVISION= 4
PORTEPOCH= 3
CATEGORIES= audio
MASTER_SITES= https://downloads.xiph.org/releases/vorbis/
......
diff --git a/oggenc/platform.c b/oggenc/platform.c
index 6d9f4ef..b66e47a 100644
--- oggenc/platform.c
+++ oggenc/platform.c
@@ -136,18 +136,22 @@ int create_directories(char *fn, int isutf8)
{
char *end, *start;
struct stat statbuf;
- char *segment = malloc(strlen(fn)+1);
+ const size_t fn_len = strlen(fn);
+ char *segment = malloc(fn_len+1);
#ifdef _WIN32
wchar_t seg[MAX_PATH+1];
#endif
start = fn;
#ifdef _WIN32
- if(strlen(fn) >= 3 && isalpha(fn[0]) && fn[1]==':')
+ // Strip drive prefix
+ if(fn_len >= 3 && isalpha(fn[0]) && fn[1]==':') {
+
start = start+2;
#endif
- while((end = strpbrk(start+1, PATH_SEPS)) != NULL)
+ // Loop through path segments, creating directories if necessary
+ while((end = strpbrk(start + strspn(start, PATH_SEPS), PATH_SEPS)) != NULL)
{
int rv;
memcpy(segment, fn, end-fn);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment