mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-13 22:53:44 +01:00
sr: BUG() on NULL sr_state before doing a state_query_*()
Part of #29706.
This commit is contained in:
parent
0cca554110
commit
9eeff921ae
@ -857,6 +857,9 @@ state_query_get_commit(const char *rsa_fpr)
|
|||||||
static void *
|
static void *
|
||||||
state_query_get_(sr_state_object_t obj_type, const void *data)
|
state_query_get_(sr_state_object_t obj_type, const void *data)
|
||||||
{
|
{
|
||||||
|
if (BUG(!sr_state))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
void *obj = NULL;
|
void *obj = NULL;
|
||||||
|
|
||||||
switch (obj_type) {
|
switch (obj_type) {
|
||||||
@ -890,6 +893,9 @@ state_query_get_(sr_state_object_t obj_type, const void *data)
|
|||||||
static void
|
static void
|
||||||
state_query_put_(sr_state_object_t obj_type, void *data)
|
state_query_put_(sr_state_object_t obj_type, void *data)
|
||||||
{
|
{
|
||||||
|
if (BUG(!sr_state))
|
||||||
|
return;
|
||||||
|
|
||||||
switch (obj_type) {
|
switch (obj_type) {
|
||||||
case SR_STATE_OBJ_COMMIT:
|
case SR_STATE_OBJ_COMMIT:
|
||||||
{
|
{
|
||||||
@ -939,6 +945,9 @@ state_query_put_(sr_state_object_t obj_type, void *data)
|
|||||||
static void
|
static void
|
||||||
state_query_del_all_(sr_state_object_t obj_type)
|
state_query_del_all_(sr_state_object_t obj_type)
|
||||||
{
|
{
|
||||||
|
if (BUG(!sr_state))
|
||||||
|
return;
|
||||||
|
|
||||||
switch (obj_type) {
|
switch (obj_type) {
|
||||||
case SR_STATE_OBJ_COMMIT:
|
case SR_STATE_OBJ_COMMIT:
|
||||||
{
|
{
|
||||||
@ -967,6 +976,9 @@ state_query_del_(sr_state_object_t obj_type, void *data)
|
|||||||
{
|
{
|
||||||
(void) data;
|
(void) data;
|
||||||
|
|
||||||
|
if (BUG(!sr_state))
|
||||||
|
return;
|
||||||
|
|
||||||
switch (obj_type) {
|
switch (obj_type) {
|
||||||
case SR_STATE_OBJ_PREVSRV:
|
case SR_STATE_OBJ_PREVSRV:
|
||||||
tor_free(sr_state->previous_srv);
|
tor_free(sr_state->previous_srv);
|
||||||
|
Loading…
Reference in New Issue
Block a user