Fossil

Check-in [cee4af9e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a crash that can occur in search when the FTS4 snippet() function returns NULL.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: cee4af9e9c2571eb6a4b688b2e194fe2370279d0bf598394bc0370ac6de86e85
User & Date: drh 2017-11-18 17:49:04
Context
2017-11-18
19:58
Improvements to the "Fossil Build Process" documentation, with improved comments in related source files. No changes to real code. check-in: 51cf7508 user: drh tags: trunk
17:49
Fix a crash that can occur in search when the FTS4 snippet() function returns NULL. check-in: cee4af9e user: drh tags: trunk
2017-11-16
02:43
Fix key bindings on the "fossil diff --tk" command. Control-q now exits. Pressing Enter does the right things at the right times and does not raise errors. Etc. check-in: 4dfa592f user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/search.c.

950
951
952
953
954
955
956

957
958
959
960
961
962
963
** converted into "<".  This is similar to htmlize() except that
** <mark> and </mark> are preserved.
*/
static char *cleanSnippet(const char *zSnip){
  int i;
  int n = 0;
  char *z;

  for(i=0; zSnip[i]; i++) if( zSnip[i]=='<' ) n++;
  z = fossil_malloc( i+n*4+1 );
  i = 0;
  while( zSnip[0] ){
    if( zSnip[0]=='<' ){
      n = isSnippetMark(zSnip);
      if( n ){







>







950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
** converted into "&lt;".  This is similar to htmlize() except that
** <mark> and </mark> are preserved.
*/
static char *cleanSnippet(const char *zSnip){
  int i;
  int n = 0;
  char *z;
  if( zSnip==0 ) zSnip = "";
  for(i=0; zSnip[i]; i++) if( zSnip[i]=='<' ) n++;
  z = fossil_malloc( i+n*4+1 );
  i = 0;
  while( zSnip[0] ){
    if( zSnip[0]=='<' ){
      n = isSnippetMark(zSnip);
      if( n ){