Skip to content

Commit

Permalink
Don't smash magic values
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Dec 21, 2015
1 parent 9bb2a54 commit 2c72229
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/state.c
Expand Up @@ -303,8 +303,7 @@ static state_entry_t *fr_state_create(fr_state_t *state, const char *server, RAD

/* Make unique for different virtual servers handling same request
*/
*((uint32_t *)(entry->state)) ^= fr_hash_string(server);

*((uint32_t *)(&entry->state[4])) ^= fr_hash_string(server);

if (!rbtree_insert(state->tree, entry)) {
talloc_free(entry);
Expand Down Expand Up @@ -349,7 +348,7 @@ static state_entry_t *fr_state_find(fr_state_t *state, const char *server, RADIU

/* Make unique for different virtual servers handling same request
*/
*((uint32_t *)(my_entry.state)) ^= fr_hash_string(server);
*((uint32_t *)(&my_entry.state[4])) ^= fr_hash_string(server);

entry = rbtree_finddata(state->tree, &my_entry);

Expand Down

0 comments on commit 2c72229

Please sign in to comment.