projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2ece5c3
)
-fixing potential NULL deref
author
Christian Grothoff
<christian@grothoff.org>
Tue, 4 Sep 2012 12:42:02 +0000
(12:42 +0000)
committer
Christian Grothoff
<christian@grothoff.org>
Tue, 4 Sep 2012 12:42:02 +0000
(12:42 +0000)
src/fs/gnunet-service-fs_pr.c
patch
|
blob
|
history
diff --git
a/src/fs/gnunet-service-fs_pr.c
b/src/fs/gnunet-service-fs_pr.c
index 3c12edfb9b1e7b8dfa241210f5f82be5b0f91166..cbe5a3e247d8601e9528feda5f44e9db8995fdb5 100644
(file)
--- a/
src/fs/gnunet-service-fs_pr.c
+++ b/
src/fs/gnunet-service-fs_pr.c
@@
-1,6
+1,6
@@
/*
This file is part of GNUnet.
/*
This file is part of GNUnet.
- (C) 2009, 2010, 2011 Christian Grothoff (and other contributing authors)
+ (C) 2009, 2010, 2011
, 2012
Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@
-1511,10
+1511,7
@@
GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp,
GNUNET_NO);
/* now, lookup 'query' */
prq.data = (const void *) &put[1];
GNUNET_NO);
/* now, lookup 'query' */
prq.data = (const void *) &put[1];
- if (NULL != cp)
- prq.sender = cp;
- else
- prq.sender = NULL;
+ prq.sender = cp;
prq.size = dsize;
prq.type = type;
prq.expiration = expiration;
prq.size = dsize;
prq.type = type;
prq.expiration = expiration;
@@
-1531,6
+1528,7
@@
GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp,
GSF_get_peer_performance_data_ (cp)->respect += prq.priority;
}
if ((GNUNET_YES == active_to_migration) &&
GSF_get_peer_performance_data_ (cp)->respect += prq.priority;
}
if ((GNUNET_YES == active_to_migration) &&
+ (NULL != cp) &&
(GNUNET_NO == test_put_load_too_high (prq.priority)))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
(GNUNET_NO == test_put_load_too_high (prq.priority)))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@
-1553,7
+1551,7
@@
GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp,
put_migration_continuation (pmc, GNUNET_SYSERR, GNUNET_TIME_UNIT_ZERO_ABS, NULL);
}
}
put_migration_continuation (pmc, GNUNET_SYSERR, GNUNET_TIME_UNIT_ZERO_ABS, NULL);
}
}
- else
+ else
if (NULL != cp)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Choosing not to keep content `%s' (%d/%d)\n",
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Choosing not to keep content `%s' (%d/%d)\n",
@@
-1561,9
+1559,10
@@
GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp,
test_put_load_too_high (prq.priority));
}
putl = GNUNET_LOAD_get_load (datastore_put_load);
test_put_load_too_high (prq.priority));
}
putl = GNUNET_LOAD_get_load (datastore_put_load);
- if ((NULL != (cp = prq.sender)) && (GNUNET_NO == prq.request_found) &&
- ((GNUNET_YES != active_to_migration) ||
- (putl > 2.5 * (1 + prq.priority))))
+ if ( (NULL != cp) &&
+ (GNUNET_NO == prq.request_found) &&
+ ( (GNUNET_YES != active_to_migration) ||
+ (putl > 2.5 * (1 + prq.priority)) ) )
{
if (GNUNET_YES != active_to_migration)
putl = 1.0 + GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 5);
{
if (GNUNET_YES != active_to_migration)
putl = 1.0 + GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 5);