diff --git a/src/libpgagroal/configuration.c b/src/libpgagroal/configuration.c index 950026e7..fa748c33 100644 --- a/src/libpgagroal/configuration.c +++ b/src/libpgagroal/configuration.c @@ -1496,6 +1496,12 @@ pgagroal_read_frontend_users_configuration(void* shm, char* filename) ptr = strtok(NULL, ":"); + if (ptr == NULL) + { + status = PGAGROAL_CONFIGURATION_STATUS_CANNOT_DECRYPT; + goto error; + } + if (pgagroal_base64_decode(ptr, strlen(ptr), &decoded, &decoded_length)) { status = PGAGROAL_CONFIGURATION_STATUS_CANNOT_DECRYPT; @@ -1637,6 +1643,12 @@ pgagroal_read_admins_configuration(void* shm, char* filename) ptr = strtok(NULL, ":"); + if (ptr == NULL) + { + status = PGAGROAL_CONFIGURATION_STATUS_CANNOT_DECRYPT; + goto error; + } + if (pgagroal_base64_decode(ptr, strlen(ptr), &decoded, &decoded_length)) { status = PGAGROAL_CONFIGURATION_STATUS_CANNOT_DECRYPT; @@ -1765,6 +1777,12 @@ pgagroal_read_superuser_configuration(void* shm, char* filename) ptr = strtok(NULL, ":"); + if (ptr == NULL) + { + status = PGAGROAL_CONFIGURATION_STATUS_CANNOT_DECRYPT; + goto error; + } + if (pgagroal_base64_decode(ptr, strlen(ptr), &decoded, &decoded_length)) { status = PGAGROAL_CONFIGURATION_STATUS_CANNOT_DECRYPT;