Skip to content

Commit

Permalink
Fix crash when epg has no title
Browse files Browse the repository at this point in the history
This was the reported error:
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_M_construct null not valid

Here is a backtrace of std::__throw_logic_error():
    #0 0x7f44aea2d919 in __sanitizer_print_stack_trace (/usr/lib64/libasan.so.6+0xbc919)
    vdr-projects#1 0x7f44a23ac14e in void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>(char const*, char const*, std::forward_iterator_tag) /usr/include/c++/11.3.0/bits/basic_string.tcc:220
    vdr-projects#2 0x7f44a23f1911 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string<std::allocator<char> >(char const*, std::allocator<char> const&) /usr/include/c++/11.3.0/bits/basic_string.h:539
    vdr-projects#3 0x7f44a23f1911 in CVNSITimers::Action() vnsiserver-f90067db10973bac36ac59f7105523dd66c0dd55/vnsitimer.c:452
    vdr-projects#4 0xd6314a in cThread::StartThread(cThread*) vdr-2.4.7/thread.c:293
    vdr-projects#5 0x7f44ad9d4535  (/lib64/libc.so.6+0x85535)
    vdr-projects#6 0x7f44ada56dfb  (/lib64/libc.so.6+0x107dfb)
  • Loading branch information
repojohnray committed Jan 10, 2023
1 parent f90067d commit 485e9b7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vnsitimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,12 @@ void CVNSITimers::Action()
if (event->EndTime() < time(nullptr))
continue;

std::string title(event->Title());
const char *p = event->Title();

if (!p)
continue;

std::string title(p);
std::smatch m;
std::regex e(Convert(searchTimer.m_search));

Expand Down

0 comments on commit 485e9b7

Please sign in to comment.