[SBI] Crash occurs when ENUM in the MAP (#2103)

This commit is contained in:
Sukchan Lee 2023-03-01 17:50:25 +09:00
parent ce668c556c
commit 969c116e77
1097 changed files with 266728 additions and 42047 deletions

View file

@ -32,16 +32,18 @@ OpenAPI_usage_threshold_t *OpenAPI_usage_threshold_create(
void OpenAPI_usage_threshold_free(OpenAPI_usage_threshold_t *usage_threshold)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == usage_threshold) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(usage_threshold);
}
cJSON *OpenAPI_usage_threshold_convertToJSON(OpenAPI_usage_threshold_t *usage_threshold)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (usage_threshold == NULL) {
ogs_error("OpenAPI_usage_threshold_convertToJSON() failed [UsageThreshold]");
@ -84,8 +86,12 @@ end:
OpenAPI_usage_threshold_t *OpenAPI_usage_threshold_parseFromJSON(cJSON *usage_thresholdJSON)
{
OpenAPI_usage_threshold_t *usage_threshold_local_var = NULL;
cJSON *duration = cJSON_GetObjectItemCaseSensitive(usage_thresholdJSON, "duration");
OpenAPI_lnode_t *node = NULL;
cJSON *duration = NULL;
cJSON *total_volume = NULL;
cJSON *downlink_volume = NULL;
cJSON *uplink_volume = NULL;
duration = cJSON_GetObjectItemCaseSensitive(usage_thresholdJSON, "duration");
if (duration) {
if (!cJSON_IsNumber(duration)) {
ogs_error("OpenAPI_usage_threshold_parseFromJSON() failed [duration]");
@ -93,8 +99,7 @@ OpenAPI_usage_threshold_t *OpenAPI_usage_threshold_parseFromJSON(cJSON *usage_th
}
}
cJSON *total_volume = cJSON_GetObjectItemCaseSensitive(usage_thresholdJSON, "totalVolume");
total_volume = cJSON_GetObjectItemCaseSensitive(usage_thresholdJSON, "totalVolume");
if (total_volume) {
if (!cJSON_IsNumber(total_volume)) {
ogs_error("OpenAPI_usage_threshold_parseFromJSON() failed [total_volume]");
@ -102,8 +107,7 @@ OpenAPI_usage_threshold_t *OpenAPI_usage_threshold_parseFromJSON(cJSON *usage_th
}
}
cJSON *downlink_volume = cJSON_GetObjectItemCaseSensitive(usage_thresholdJSON, "downlinkVolume");
downlink_volume = cJSON_GetObjectItemCaseSensitive(usage_thresholdJSON, "downlinkVolume");
if (downlink_volume) {
if (!cJSON_IsNumber(downlink_volume)) {
ogs_error("OpenAPI_usage_threshold_parseFromJSON() failed [downlink_volume]");
@ -111,8 +115,7 @@ OpenAPI_usage_threshold_t *OpenAPI_usage_threshold_parseFromJSON(cJSON *usage_th
}
}
cJSON *uplink_volume = cJSON_GetObjectItemCaseSensitive(usage_thresholdJSON, "uplinkVolume");
uplink_volume = cJSON_GetObjectItemCaseSensitive(usage_thresholdJSON, "uplinkVolume");
if (uplink_volume) {
if (!cJSON_IsNumber(uplink_volume)) {
ogs_error("OpenAPI_usage_threshold_parseFromJSON() failed [uplink_volume]");