Skip to content

Commit

Permalink
try to fix a couple more core dumps.
Browse files Browse the repository at this point in the history
  • Loading branch information
gigablast committed Feb 19, 2016
1 parent c7696a6 commit da9949f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
7 changes: 5 additions & 2 deletions RdbList.cpp
Expand Up @@ -1686,9 +1686,12 @@ void RdbList::merge_r ( RdbList **lists ,
// did they call prepareForMerge()?
if ( m_mergeMinListSize == -1 ) {
log(LOG_LOGIC,"db: rdblist: merge_r: prepareForMerge() not "
"called.");
"called. ignoring error and returning emtpy list.");
// this happens if we nuke doledb during a merge of it. it
// is just bad timing
return;
// save state and dump core, sigBadHandler will catch this
char *p = NULL; *p = 0;
//char *p = NULL; *p = 0;
}
// already there?
if ( minRecSizes >= 0 && m_listSize >= minRecSizes ) return;
Expand Down
12 changes: 10 additions & 2 deletions Tagdb.cpp
Expand Up @@ -2603,7 +2603,7 @@ bool Msg8a::getTagRec ( Url *url ,
// . msge0 passes this in as NULL an expects us to figure it out
// . if site was NULL that means we guess it. default to hostname
// unless in a recognized for like /~mwells/
if ( ! site ) {
if ( ! site || siteLen <= 0 ) {
SiteGetter sg;
sg.getSite ( url->getUrl() ,
NULL , // tagrec
Expand All @@ -2622,11 +2622,19 @@ bool Msg8a::getTagRec ( Url *url ,

// if provided site was NULL and not of a ~mwells type of form
// then default it to hostname
if ( ! site ) {
if ( ! site || siteLen <= 0 ) {
site = url->getHost();
siteLen = url->getHostLen();
}

// if still the host is bad, then forget it
if ( ! site || siteLen <= 0 ) {
log("tagdb: got bad url with no site");
m_errno = EBADURL;
g_errno = EBADURL;
return true;
}

// temp null terminate it
char c = site[siteLen];
site[siteLen] = '\0';
Expand Down

0 comments on commit da9949f

Please sign in to comment.