tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
* [patch] avoid possible null pointer dereference
@ 2013-05-17  1:37 Ulrich Spörlein
  2013-05-18 17:54 ` Ingo Schwarze
  0 siblings, 1 reply; 3+ messages in thread
From: Ulrich Spörlein @ 2013-05-17  1:37 UTC (permalink / raw)
  To: tech

[-- Attachment #1: Type: text/plain, Size: 247 bytes --]

And the last one,

termp_xx_pre() will call term_word() with NULL when the switch case
falls through to the default case. There are several ways to avoid the
segfault, not sure this is the best one.

This is Coverity Scan CID 976115.

Cheers,
Uli

[-- Attachment #2: mdoc_term.diff --]
[-- Type: text/x-diff, Size: 430 bytes --]

Index: mdoc_term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v
retrieving revision 1.245
diff -u -p -r1.245 mdoc_term.c
--- mdoc_term.c	17 Nov 2012 00:26:33 -0000	1.245
+++ mdoc_term.c	17 May 2013 01:32:03 -0000
@@ -1756,7 +1756,7 @@ termp_xx_pre(DECL_ARGS)
 		pp = "UNIX";
 		break;
 	default:
-		break;
+		return(0);
 	}
 
 	term_word(p, pp);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-18 19:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-17  1:37 [patch] avoid possible null pointer dereference Ulrich Spörlein
2013-05-18 17:54 ` Ingo Schwarze
2013-05-18 19:26   ` Ulrich Spörlein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).