diff options
author | woro <woro@e10066b5-e1e2-0310-b819-94efdf66514b> | 2008-02-07 09:15:55 +0000 |
---|---|---|
committer | woro <woro@e10066b5-e1e2-0310-b819-94efdf66514b> | 2008-02-07 09:15:55 +0000 |
commit | f72a13125d2be05cf090c1b804c34b510b1db81a (patch) | |
tree | 234dcb8add87065359982819c5e1168b00f29159 | |
parent | 7d34c0408ac2b92723eeac552041bb74cd2c3bac (diff) | |
download | vdr-plugin-muggle-f72a13125d2be05cf090c1b804c34b510b1db81a.tar.gz vdr-plugin-muggle-f72a13125d2be05cf090c1b804c34b510b1db81a.tar.bz2 |
prevent NULL dereference
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@998 e10066b5-e1e2-0310-b819-94efdf66514b
-rw-r--r-- | mg_db.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -71,9 +71,10 @@ mgSQLString::Init(const char* s) m_original = strdup(s); char *p=strrchr(m_original,' '); - if (p+1 == strchr(m_original,0)) - while (p>=m_original && *p==' ') - *p-- = 0; + if (p) + if (p+1 == strchr(m_original,0)) + while (p>=m_original && *p==' ') + *p-- = 0; #ifdef HAVE_SQLITE m_str = new mgSQLStringSQLite(m_original); |