Q:

Getting Strange Segmentation Fault In Code

Im getting a strange segmentation fault. I almost ignored it for it only appeared when the strings that were passed to the function begin with the letter v or greater. The program consists of an array of 26 linked list pointers and a function that creates a new node, sorts them (using another function and then adds them to the array of linked lists). Heres the code where the segmentation fault is experienced.
 void sort(contact* newContact,int ind, contact** array[]){

    contact* current; //pointer to current contact

    //Case to test if the contact belongs at the head ###SEGMENTATION FAULT IF name begins with 'v'
    if ((*array)[ind] == NULL || strcmp(&(*array)[ind]->name[0],&newContact->name[0])>0){

        newContact->next=(*array)[ind]; // contect next pointer is equal to the pointer at index 'ind'

       (*array)[ind]=newContact; //goes to array and change the pointer at the index 'ind'   
    }

    else{

        current=(*array)[ind]; //updates the current pointer to the first pointer in the index 'ind'

        //finds the position to insert contact
        while(current->next!=NULL&&strcmp(&current->next->name[0],&newContact->name[0])<0){

            current=current->next; //updates pointer if current is not NULL or current is smaller than new contact
        }

        //the loop will break at the insertion point. 
        //inserts contact
        newContact->next=current->next;
        current->next=newContact;

   }

    printf("ADDED\n");
    }

And here is the code that creates the node, along with the code that collects the input in the case it goes wrong somewhere
void addContact(contact* list[]){
contact* new= malloc(sizeof(contact)); // creates new contact and allocates memory for it

printf("NAME: ");
new->name=GetInput(1); //saves the name
printf("NUMBER: ");
new->number=GetInput(0); //saves the number

int x=GetIndex(new->name);
contact** ptr=&list[x];
sort(new,x, &ptr);

printf("Contact Added!\n");
}

For this function, if the type is 1, it ensures the string entered begins with an alphabetical character. If not, it is left alone
char* GetInput(int type){
int loop=0;
char* buffer; //stores the entire input from the user 

if (type==1){

    do {
        scanf("%ms",&buffer); //takes input from user

        //checks if alphabetical
        if (isalpha(buffer[0]))
            loop=1;

        else{
            printf("Try again\nThe first character must be alphabetical\n");
            free(buffer);
        }
    }
    while(loop==0);    
}

//when 1 isnt specified, the input is left untreated
else{
    scanf("%ms",&buffer);
}

return buffer;

}

A:

This code has a lot of problems.  The first thing you need to do is to crank up the warning settings on your compiler as high as they'll go.  There's a lot of stuff here that isn't a syntax error, but is still a mistake.  
One major problem (and I suspect the source of your runtime errors) is in getInput:
char* GetInput(int type){
int loop=0;
char* buffer; //stores the entire input from the user 

No.  All buffer stores is a single pointer value; you haven't actually set aside any
storage for the input.  buffer doesn't point anywhere meaningful.  Since it's declared auto and you don't explicitly initialize it, buffer will initially contain a random bit pattern that may correspond to a writable address, a protected address, or a trap representation; that is, a bit pattern that cannot be a valid pointer value.  
Attempting to write through an invalid pointer value will invoke undefined behavior, which simply means the compiler isn't required to handle the coding error in any particular way.  It may issue a diagnostic and halt translation, issue a diagnostic and continue translation, or ignore the problem completely.  If it completes translation and produces a binary, that binary may crash immediately, or it may limp along in a bad state until something else causes it to crash later on, or it may appear to function normally.  
However, you've cleverly sidestepped the whole issue as follows:
if (type==1){

    do {
        scanf("%ms",&buffer); //takes input from user
                    ^^^^^^^

Instead of passing buffer as your argument (like you should), you pass &buffer.  Unlike buffer, &buffer is a valid pointer (it's the address of the buffer variable), so you're not trying to write through an invalid pointer.  Unfortunately, &buffer has the wrong type - char ** instead of char *.  Your compiler should have warned you about this; if it didn't, raise the warning level (also, m is not a valid modifier for the %s conversion specifier AFAIK; what is it supposed to do?).  
Problem is, the buffer variable is only large enough to store a single char * value (anywhere from 2 to 4 to 8 bytes wide, depending on the platform); so if char * on your platform is 4 bytes wide, you could store a string of up to 3 characters plus the terminating 0 character, and nothing "bad" would happen (that is, you wouldn't overwrite memory belonging to a different object).  Anything longer and you risk clobbering something important (likely leading to the "limp along in a bad state until something else causes a crash later" outcome).  
Here's one way, if not necessarily the best way, to fix that code (reformatting to make it easier on my rapidly aging eyes; obviously, formatting is largely a matter of taste, so you can reformat this to however you like):
#define FIXED_BUFFER_LEN 20 // Initial buffer size; make this large enough to
                            // handle most of your expected inputs

char* GetInput( int type )
{
  int loop = 1; // yes, I'm changing the sense of this test

  /**
   * Create a local, temporary buffer for input, large enough to handle
   * most expected inputs
   */
  char tempBuffer[FIXED_BUFFER_LEN + 1];

  /**
   * Output buffer pointer, initialized to a known *invalid* value
   */
  char* buffer = NULL;

  /**
   * Build a format string for our scanf statements; a %s without a 
   * maximum length specifier is a gaping security hole.
   */
  char fmt[15]; // stores a string of the form "%DDD...s", where DDD... is 
                //the field width specifier; for example, "%20s"

  /**
   * Honestly, you want to check the result of the following operation,
   * but I've already spent more time on this than I expected.
   */
  sprintf( fmt, "%%%ds", FIXED_BUFFER_LEN );

  if (type==1)
  {
    do 
    {
      scanf( fmt, tempBuffer ); //takes input from user

      //checks if alphabetical
      if ( isalpha( tempBuffer[0] ))
        loop=0;

      else
      {
        printf( "Try again\nThe first character must be alphabetical\n" );
      }
  }
  while( loop );    
}

//when 1 isnt specified, the input is left untreated
else
{
  scanf( fmt, tempBuffer );
}

/**
 * Only now, after we've validated our input, do we allocate the 
 * dynamic memory for the buffer. 
 */ 
buffer = calloc( strlen( tempBuffer ) + 1, sizeof *buffer );
if ( buffer )
  strcpy( buffer, tempBuffer );

return buffer;

}
There are still some problems with this code (scanf has many issues), but this should get you moving in the right direction.  Turn up the warning settings on your compiler as high as they will go, and analyze and repair every one of them.  

