2004.03.10 (水) 23:07:47 <u*j*2*6*> Exception in ProcessCommand (id=200,cmd (省略) ,query=0,pos=122621) : Access violation at〜 というエラーがでる環境があるので修正しました

shuusei241117:共有0のユーザーが検索しようとすると例外が起きるバグを修正

diff --dos -urN 241116/SlavaNap.dof 241117/SlavaNap.dof
--- 241116/SlavaNap.dof	Wed Mar 10 01:11:16 2004
+++ 241117/SlavaNap.dof	Wed Mar 10 22:57:02 2004
@@ -79,5 +79,5 @@
 LegalTrademarks=http://www.slavanap.org/
 OriginalFilename=slavanap.exe
 ProductName=Delphi6でコンパイルしてあります
-ProductVersion=2.4.1.108.116
-Comments=shuusei241116:ユーザー申告ポート・アクセス監視ポートの設定変更時にメモリリークするバグを修正
+ProductVersion=2.4.1.108.117
+Comments=shuusei241117:共有0のユーザーが検索しようとすると例外が起きるバグを修正
Binary files 241116/SlavaNap.res and 241117/SlavaNap.res differ
diff --dos -urN 241116/constants.pas 241117/constants.pas
--- 241116/constants.pas	Wed Mar 10 00:23:04 2004
+++ 241117/constants.pas	Wed Mar 10 22:15:02 2004
@@ -27,7 +27,7 @@
  SLAVANAP_VERSION             = '2.4.1';
  SLAVANAP_BUILD               = '108';
  SLAVANAP_BUILD_DATE          = '24 January 2003';
- SLAVANAP_SHUUSEI             = '116';
+ SLAVANAP_SHUUSEI             = '117';
  SLAVANAP_SHUUSEI_DATE        = '10 March 2004';
  SLAVANAP_VERSION_SHORT       = SLAVANAP_TITLE+' '+SLAVANAP_VERSION;
  SLAVANAP_FULL                = SLAVANAP_TITLE+' '+SLAVANAP_VERSION+
diff --dos -urN 241116/handler.pas 241117/handler.pas
--- 241116/handler.pas	Sun Mar 07 21:45:42 2004
+++ 241117/handler.pas	Wed Mar 10 23:00:18 2004
@@ -3172,7 +3172,7 @@
 
 procedure Handler_Search;
 var
- i,j,k:Integer;
+ i, j, k, sharecount:Integer;
  dec: Integer;
  err: Boolean;
  srv: TServer;
@@ -3281,14 +3281,18 @@
    if local.level<napUserModerator then
    if not StrHash_FindString(db_friends,local.nick,true) then
    begin
+     if local.shared <> nil then
+       sharecount := local.shared.Count
+     else
+       sharecount := 0;
      if searchblock_chkfiles and searchblock_chksize then
      begin
        if searchblock_hard then
        begin
-         if local.shared.Count<searchblock_files then
+         if sharecount < searchblock_files then
          begin
            local.Exec(MSG_SERVER_NOSUCH, Format(RS_Handler_BlockPoorFilesSearch,
-             [local.shared.Count, searchblock_files]));
+             [sharecount, searchblock_files]));
            local.Exec(MSG_SERVER_SEARCH_END,'');
            exit;
          end;
@@ -3301,20 +3305,20 @@
          end;
        end
        else
-       if (local.shared.Count<searchblock_files) and
+       if (sharecount < searchblock_files) and
           (local.shared_size<searchblock_size) then
        begin
          local.Exec(MSG_SERVER_NOSUCH, Format(RS_Handler_BlockPoorShareSearch,
-           [local.shared.Count, searchblock_files, local.shared_size div Megabyte,
+           [sharecount, searchblock_files, local.shared_size div Megabyte,
            searchblock_size div Megabyte]));
          local.Exec(MSG_SERVER_SEARCH_END,'');
          exit;
        end;
      end
-     else if searchblock_chkfiles and (local.shared.Count<searchblock_files) then
+     else if searchblock_chkfiles and (sharecount < searchblock_files) then
      begin
        local.Exec(MSG_SERVER_NOSUCH, Format(RS_Handler_BlockPoorFilesSearch,
-         [local.shared.Count, searchblock_files]));
+         [sharecount, searchblock_files]));
        local.Exec(MSG_SERVER_SEARCH_END,'');
        exit;
      end
@@ -3728,7 +3732,7 @@
         (local<>nil) and (local.shared_size<=domblock_size) then
      begin
        local.Exec(MSG_SERVER_NOSUCH, Format(RS_Handler_BlockPoorShareDL,
-         [local.shared.Count, domblock_files, local.shared_size div Megabyte, domblock_size div Megabyte]));
+         [user^.shared, domblock_files, local.shared_size div Megabyte, domblock_size div Megabyte]));
        exit;
      end;
    end
@@ -4000,7 +4004,7 @@
      begin
        local.Exec(MSG_SERVER_BROWSE_END,gcmd.cmd);
        local.Exec(MSG_SERVER_NOSUCH, Format(RS_Handler_BlockPoorShareBrowse,
-         [local.shared.Count, domblock_files, local.shared_size div Megabyte, domblock_size div Megabyte]));
+         [user^.shared, domblock_files, local.shared_size div Megabyte, domblock_size div Megabyte]));
        exit;
      end;
    end
Binary files 241116/output/SlavaNap.exe and 241117/output/SlavaNap.exe differ