Catch NULL sb_reader->sb in initialization
authorAggelos Economopoulos <aoiko@cc.ece.ntua.gr>
Mon, 25 May 2009 21:46:02 +0000 (00:46 +0300)
committerAggelos Economopoulos <aoiko@cc.ece.ntua.gr>
Mon, 25 May 2009 21:51:27 +0000 (00:51 +0300)
sys/kern/uipc_sockbuf.c

index c03c7b8..0de34b3 100644 (file)
@@ -711,6 +711,7 @@ sb_flush(struct sockbuf *sb)
 void
 sb_reader_init(struct sb_reader *sr, struct sockbuf *sb)
 {
+       KKASSERT(sb != NULL);   /* catch this early */
        sr->sb = sb;
        sr->max_len = sb_cc_est(sb); /* XXX use mbcnt_est */
        cpu_lfence();