Skip to content

Commit 7cc5bfb

Browse files
committed
gui: fix misnamed live table column
1 parent 6c5c10f commit 7cc5bfb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/disco/gui/fd_gui_peers.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,11 +949,15 @@ fd_gui_peers_request_sort( fd_gui_peers_ctx_t * peers,
949949
for( c = _col->child, i=0UL; c; c = c->next, i++ ) {
950950
if( FD_UNLIKELY( i >= fd_gui_peers_live_table_col_cnt() ) ) return FD_HTTP_SERVER_CONNECTION_CLOSE_BAD_REQUEST;
951951
sort_key.col[ i ] = fd_gui_peers_live_table_col_name_to_idx( peers->live_table, c->valuestring );
952+
if( FD_UNLIKELY( sort_key.col[ i ]==ULONG_MAX ) ) {
953+
FD_LOG_WARNING(( "unexpected column name %s", c->valuestring ));
954+
return FD_HTTP_SERVER_CONNECTION_CLOSE_BAD_REQUEST;
955+
}
952956
}
953957
} while( 0 );
954958

955959
const cJSON * _dir = cJSON_GetObjectItemCaseSensitive( params, "dir" );
956-
if( FD_UNLIKELY( !cJSON_IsArray( _dir ) ) ) { FD_LOG_WARNING(("NOT ARRAY 2")); return FD_HTTP_SERVER_CONNECTION_CLOSE_BAD_REQUEST; }
960+
if( FD_UNLIKELY( !cJSON_IsArray( _dir ) ) ) return FD_HTTP_SERVER_CONNECTION_CLOSE_BAD_REQUEST;
957961

958962
do {
959963
cJSON * c;

src/disco/gui/fd_gui_peers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ static int live_table_col_stake_lt ( void const * a, void const * b ) { return f
288288
LIVE_TABLE_COL_ENTRY( "Stake", stake, live_table_col_stake_lt ), \
289289
LIVE_TABLE_COL_ENTRY( "Pubkey", contact_info.pubkey, live_table_col_pubkey_lt ), \
290290
LIVE_TABLE_COL_ENTRY( "Name", name, live_table_col_name_lt ), \
291-
LIVE_TABLE_COL_ENTRY( "CC", country_code_idx, live_table_col_uchar_lt ), \
291+
LIVE_TABLE_COL_ENTRY( "Country", country_code_idx, live_table_col_uchar_lt ), \
292292
LIVE_TABLE_COL_ENTRY( "IP Addr", contact_info.sockets[ FD_CONTACT_INFO_SOCKET_GOSSIP ].addr, live_table_col_ipv4_lt ), \
293293
LIVE_TABLE_COL_ENTRY( "Ingress Push", gossvf_rx[ FD_METRICS_ENUM_GOSSIP_MESSAGE_V_PUSH_IDX ].rate_ema, live_table_col_long_lt ), \
294294
LIVE_TABLE_COL_ENTRY( "Ingress Pull", gossvf_rx[ FD_METRICS_ENUM_GOSSIP_MESSAGE_V_PULL_RESPONSE_IDX ].rate_ema, live_table_col_long_lt ), \

0 commit comments

Comments
 (0)