Fossil

Check-in [43981c5d]
Login

Check-in [43981c5d]

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

Overview
Comment:Remove redundant length check from captcha processing. Forum post f406019983.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 43981c5d6234d830c4be4cf9fc4691e5a1e9a5544f13db9af80a25e80fe83dc7
User & Date: drh 2021-01-27 14:14:17
Original Comment: Remove redundant length check from captcha processing. [Forum post f406019983|forum:/forumpost/f406019983].
Context
2021-01-27
14:40
Begin a change log for version 2.15. ... (check-in: 0412039e user: drh tags: trunk)
14:14
Remove redundant length check from captcha processing. Forum post f406019983. ... (check-in: 43981c5d user: drh tags: trunk)
13:32
More TH1 performance optimizations: Go directly to malloc() rather than through the Th_Malloc() intermediary. ... (check-in: 9b4f2d8e user: drh tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/captcha.c.

512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
  }
  zSeed = P("captchaseed");
  if( zSeed==0 ) return 0;
  zEntered = P("captcha");
  if( zEntered==0 || strlen(zEntered)!=8 ) return 0;
  zDecode = captcha_decode((unsigned int)atoi(zSeed));
  assert( strlen(zDecode)==8 );
  if( strlen(zEntered)!=8 ) return 0;
  for(i=0; i<8; i++){
    char c = zEntered[i];
    if( c>='A' && c<='F' ) c += 'a' - 'A';
    if( c=='O' ) c = '0';
    z[i] = c;
  }
  if( strncmp(zDecode,z,8)!=0 ) return 0;







<







512
513
514
515
516
517
518

519
520
521
522
523
524
525
  }
  zSeed = P("captchaseed");
  if( zSeed==0 ) return 0;
  zEntered = P("captcha");
  if( zEntered==0 || strlen(zEntered)!=8 ) return 0;
  zDecode = captcha_decode((unsigned int)atoi(zSeed));
  assert( strlen(zDecode)==8 );

  for(i=0; i<8; i++){
    char c = zEntered[i];
    if( c>='A' && c<='F' ) c += 'a' - 'A';
    if( c=='O' ) c = '0';
    z[i] = c;
  }
  if( strncmp(zDecode,z,8)!=0 ) return 0;