RUNTİME ERROR

,

I’VE GOT RUNTİME ERROR, MOST PROBABLY IT’s ABOUT WRONG MEMORY ADRESS. HELP IS APPRECİATED

#include <stdio.h>
#include <string.h>

#define MAX_SIZE (10^6)

void left_reverse(char *a,char *b)
{
    int len = strlen(a);
    for (int i = 0; i < len; i++)
    {
        if (i==0)
        {
            *(b+len)='\0';
            *(b+len-1)=a[i];
        }

        else
        {
            *(b+i-1)=a[i];
        }
        
    }
    

}

void right_reverse(char *a,char *b)
{
    int len = strlen(a);
    for (int i = 0; i < len; i++)
    {
        if (i==len-1)
        {
            *(b+len)='\0';
            *(b+0)=a[i];
        }

        else
        {
            *(b+i+1)=a[i];
        }
        
    }
    

}

int main(void)
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        char array[MAX_SIZE+1],left[MAX_SIZE+1],right[MAX_SIZE+1];
        scanf("%s",array);
        int len = strlen(array);
        

        left_reverse(array,left);
        right_reverse(array,right);

        
        
        int count=0;
        for (int i = 0; i < len; i++)
        {
            if (left[i]==right[i])
            {
                count++;
            }
            
        }
        

        if(count==len)
        {
            printf("YES\n");
        }

        else
        {
            printf("NO\n");
        }
        


    }
    return 0;
}