openbsd-ports/audio/vorbis-tools/patches/patch-ogg123_vorbis_comments_c

15 lines
411 B
Plaintext

strcspn(3) does not work this way, fix SIGSEGV on unknown comments
Index: ogg123/vorbis_comments.c
--- ogg123/vorbis_comments.c.orig
+++ ogg123/vorbis_comments.c
@@ -74,7 +74,7 @@ char *lookup_comment_prettyprint (const char *comment,
/* Use default formatting */
j = strcspn(comment, "=");
- if (j) {
+ if (j != strlen(comment)) {
*offset = j + 1;
s = malloc(j + 2);
if (s == NULL) {