summaryrefslogtreecommitdiff
path: root/doc/README.developer
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2005-03-23 02:48:47 +0000
committerGuy Harris <guy@alum.mit.edu>2005-03-23 02:48:47 +0000
commit5a6cf590625cede24a176b7e3864b938eee9bb90 (patch)
treefd3757182f07eeaa6829618a1026e8161c526527 /doc/README.developer
parentd4d1206ad5f1bf7374f279addc89e6dc74bd099f (diff)
downloadwireshark-5a6cf590625cede24a176b7e3864b938eee9bb90.tar.gz
Thou shalt not g_assert() in a dissector.
svn path=/trunk/; revision=13875
Diffstat (limited to 'doc/README.developer')
-rw-r--r--doc/README.developer7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/README.developer b/doc/README.developer
index cea3bc87e1..050876fc47 100644
--- a/doc/README.developer
+++ b/doc/README.developer
@@ -323,6 +323,13 @@ packets without crashing or looping infinitely.
Here are some suggestions for making dissectors more robust in the face
of incorrectly-formed packets:
+Do *NOT* use "g_assert()" or "g_assert_not_reached()" in dissectors.
+*NO* value in a packet's data should be considered "wrong" in the sense
+that it's a problem with the dissector if found; if it cannot do
+anything else with a particular value from a packet's data, the
+dissector should put into the protocol tree an indication that the
+value is invalid, and should return.
+
If you are allocating a chunk of memory to contain data from a packet,
or to contain information derived from data in a packet, and the size of
the chunk of memory is derived from a size field in the packet, make