* [PATCH] overwritten assignment in sanitise_setsockopt
@ 2013-04-02 11:40 Nicolas Kaiser
2013-04-02 14:15 ` Dave Jones
0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Kaiser @ 2013-04-02 11:40 UTC (permalink / raw)
To: trinity
I noticed an assignment that gets immediately overwritten, contradicting
a nearby comment.
According to the comment, 'optval' should get disabled half of the time.
As at the time of the conditional assignment optval was already set to
different nonzero values, it looks to me like the trailing assignment,
which was introduced in commit 737e1a71, may be unintended.
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
---
syscalls/setsockopt.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/syscalls/setsockopt.c b/syscalls/setsockopt.c
index 4d5877b..ce610af 100644
--- a/syscalls/setsockopt.c
+++ b/syscalls/setsockopt.c
@@ -322,8 +322,6 @@ void sanitise_setsockopt(int childno)
*/
if (rand() % 2)
shm->a4[childno] = 0;
-
- shm->a4[childno] = sizeof(int);
}
struct syscall syscall_setsockopt = {
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] overwritten assignment in sanitise_setsockopt
2013-04-02 11:40 [PATCH] overwritten assignment in sanitise_setsockopt Nicolas Kaiser
@ 2013-04-02 14:15 ` Dave Jones
0 siblings, 0 replies; 2+ messages in thread
From: Dave Jones @ 2013-04-02 14:15 UTC (permalink / raw)
To: Nicolas Kaiser; +Cc: trinity
On Tue, Apr 02, 2013 at 01:40:03PM +0200, Nicolas Kaiser wrote:
> I noticed an assignment that gets immediately overwritten, contradicting
> a nearby comment.
> According to the comment, 'optval' should get disabled half of the time.
>
> As at the time of the conditional assignment optval was already set to
> different nonzero values, it looks to me like the trailing assignment,
> which was introduced in commit 737e1a71, may be unintended.
Good catch. Applied.
thanks,
Dave
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-04-02 14:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-02 11:40 [PATCH] overwritten assignment in sanitise_setsockopt Nicolas Kaiser
2013-04-02 14:15 ` Dave Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox