Skip to content

Commit 08a1a15

Browse files
kabakakaosparrc
authored andcommitted
aws: addtional changes mentioned by coderabbit
Signed-off-by: Stephan <[email protected]>
1 parent a751b96 commit 08a1a15

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/aws/flb_aws_util.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ char *flb_aws_endpoint(char* service, char* region)
8888
strcmp("cn-northwest-1", region) == 0) {
8989
domain_suffix = AWS_SERVICE_ENDPOINT_SUFFIX_COM_CN;
9090
}
91-
else if (strcmp("eusc-de-east-1", region) == 0) {
91+
else if (strncmp(region, "eusc-", 5) == 0) {
9292
domain_suffix = AWS_SERVICE_ENDPOINT_SUFFIX_EU;
9393
}
9494

@@ -105,7 +105,7 @@ char *flb_aws_endpoint(char* service, char* region)
105105
}
106106

107107
bytes = snprintf(endpoint, len, AWS_SERVICE_ENDPOINT_FORMAT, service, region, domain_suffix);
108-
if (bytes < 0) {
108+
if (bytes < 0 || bytes >= len) {
109109
flb_errno();
110110
flb_free(endpoint);
111111
return NULL;

0 commit comments

Comments
 (0)