 
     while (*p != '"') {
       sender[i++] = *p++;
+      if (i >= sizeof(sender)) break;
     }
 
     while (*p != '\n') ++p; ++p;

  };
}

int16_t gsmGetSignalQuality() {
  gsmSendCommand_P(F("AT+CSQ"));

  char* p = strstr(gsmSerialBuffer, "CSQ: ");

  if (p) {
    p += 5;
    uint8_t i = 0;
    char buffer[3];

    while (*p != ',') {
      buffer[i++] = *(p++);
    }

    int n = atoi(buffer);
    if (n == 99 || n == -1) return 0;
    return n * 2 - 114;
  }

  return 0;

      reboot();
    }

    lastUpload = millis();
  }
}
