Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Stricter syntax checking of the %V tag - pay attention to the return-code from parse_list, and check for the tailing | symbol.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16784 a1c6a512-1295-4272-9138-f99709370657

+14 -6
+14 -6
apps/gui/wps_parser.c
··· 26 26 #include "gwps.h" 27 27 #ifndef __PCTOOL__ 28 28 #include "settings.h" 29 + #include "misc.h" 29 30 #include "debug.h" 30 31 #include "plugin.h" 31 32 ··· 562 563 #ifdef HAVE_LCD_COLOR 563 564 if (depth == 16) 564 565 { 565 - parse_list("dddddcc", '|', ptr, &vp->x, &vp->y, &vp->width, 566 - &vp->height, &vp->font, &vp->fg_pattern,&vp->bg_pattern); 566 + if (!(ptr = parse_list("dddddcc", '|', ptr, &vp->x, &vp->y, &vp->width, 567 + &vp->height, &vp->font, &vp->fg_pattern,&vp->bg_pattern))) 568 + return WPS_ERROR_INVALID_PARAM; 567 569 } 568 570 else 569 571 #endif 570 572 #if (LCD_DEPTH == 2) || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH == 2) 571 573 if (depth == 2) { 572 - parse_list("dddddgg", '|', ptr, &vp->x, &vp->y, &vp->width, 573 - &vp->height, &vp->font, &vp->fg_pattern, &vp->bg_pattern); 574 + if (!(ptr = parse_list("dddddgg", '|', ptr, &vp->x, &vp->y, &vp->width, 575 + &vp->height, &vp->font, &vp->fg_pattern, &vp->bg_pattern))) 576 + return WPS_ERROR_INVALID_PARAM; 574 577 } 575 578 else 576 579 #endif 577 580 #if (LCD_DEPTH == 1) || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH == 1) 578 581 if (depth == 1) 579 582 { 580 - parse_list("ddddd", '|', ptr, &vp->x, &vp->y, &vp->width, &vp->height, 581 - &vp->font); 583 + if (!(ptr = parse_list("ddddd", '|', ptr, &vp->x, &vp->y, &vp->width, 584 + &vp->height, &vp->font))) 585 + return WPS_ERROR_INVALID_PARAM; 582 586 } 583 587 else 584 588 #endif 585 589 {} 590 + 591 + /* Check for trailing | */ 592 + if (*ptr != '|') 593 + return WPS_ERROR_INVALID_PARAM; 586 594 587 595 /* Default to using the user font if the font was an invalid number */ 588 596 if ((vp->font != FONT_SYSFIXED) && (vp->font != FONT_UI))