Changeset 28732

Show
Ignore:
Timestamp:
02.12.2013 18:52:05 (6 years ago)
Author:
ak19
Message:

Diego found a bug that crashed the server in his collection which set the OIDtype to incremental and used a classifier on dc.Subject meta. When the OIDs generated were too short, such as happens when maxdocs is low or the number of docs in the collection is low, the server crashes. Have now added a test in the dbclass.cpp code that ensures we don't substring the OID's tail if this is too short for the substring operation. This now works with Diego's collection which used to crash for me before.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/src/lib/dbclass.cpp

    r19287 r28732  
    194194    tailarray.push_back(tail); 
    195195    OID.erase (OID.end()-3, OID.end()); 
    196     tail = substr (OID.end()-3, OID.end()); 
     196 
     197    if(OID.size() <= 3) { 
     198        break; 
     199    } else { 
     200        tail = substr (OID.end()-3, OID.end()); 
     201    } 
    197202    if (tail == ".rt") { 
    198203      get_top (inOID, OID);