summaryrefslogtreecommitdiff
path: root/randpkt_core
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2016-07-10 15:12:05 +0100
committerJoão Valverde <j@v6e.pt>2016-07-10 14:28:22 +0000
commitdec3e2e8aa343f5acdc61df67826b0951b13a663 (patch)
tree730091b86680db9f72043ba69ea61a475d1b55f9 /randpkt_core
parent3ea8ccf69f67387c779c6038c9d826bb13f57463 (diff)
downloadwireshark-dec3e2e8aa343f5acdc61df67826b0951b13a663.tar.gz
randpkt_core: Use g_random_* for randpkt_parse_type().
randpkt_parse_type() can (and most likely will) be called before randpkt_example_init(), therefore g_rand_int_range is called with a NULL GRand argument. This produces non-random output. Change-Id: Id420edc15a5f9dec427c5f1a1dd9a1f18a225319 Reviewed-on: https://code.wireshark.org/review/16367 Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'randpkt_core')
-rw-r--r--randpkt_core/randpkt_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/randpkt_core/randpkt_core.c b/randpkt_core/randpkt_core.c
index b29b18bccc..8e7bce1a69 100644
--- a/randpkt_core/randpkt_core.c
+++ b/randpkt_core/randpkt_core.c
@@ -723,7 +723,7 @@ int randpkt_parse_type(char *string)
/* Called with NULL, choose a random packet */
if (!string) {
- return examples[g_rand_int_range(pkt_rand, 0, num_entries)].produceable_type;
+ return examples[g_random_int_range(0, num_entries)].produceable_type;
}
for (i = 0; i < num_entries; i++) {