Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
dvbpsi: fix the dvb_desc_service() fcn - stack corruption (clang sani…
…tizer)
  • Loading branch information
perexg committed Jun 17, 2016
1 parent 24bc73b commit 7115239
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -28,7 +28,7 @@ LANGUAGES ?= bg cs da de en_US en_GB es et fa fi fr he hr hu it lv nl pl pt ru s
# Common compiler flags
#

CFLAGS += -g -O2 -fPIE
CFLAGS += -g -O0 -fPIE

This comment has been minimized.

Copy link
@EricV2

EricV2 Jun 18, 2016

I suppose this is a left over! Compiling with -O0 execpt to debug...

This comment has been minimized.

Copy link
@perexg

perexg Jun 18, 2016

Author Contributor

Yes. Thanks. Fixed in 60e0227 .

ifeq ($(CONFIG_PIE),yes)
CFLAGS += -fPIE
else
Expand Down
13 changes: 6 additions & 7 deletions src/input/mpegts/dvb_psi.c
Expand Up @@ -418,14 +418,13 @@ dvb_desc_service

/* Cleanup name */
str = sname;
while (*str && *str <= 32)
while (*str && *str <= ' ')
str++;
memmove(sname, str, sname_len); // Note: could avoid this copy by passing an output ptr
l = strlen(str);
while (l > 1 && str[l-1] <= 32) {
str[l-1] = 0;
l--;
}
if (str != sname)
memmove(sname, str, sname_len - (str - sname));
l = strlen(str);
while (l > 1 && str[l-1] <= ' ')
str[--l] = '\0';

return 0;
}
Expand Down

0 comments on commit 7115239

Please sign in to comment.