Wed May 13 13:02:06 CDT 2009 Pekka Pessi <first.last@nokia.com>

* msg_parser_util.c: fixed msg_unquoted_e()
  Ignore-this: 78b9afb6e97ff730d7924d860ef33921
  
  Now accepts NULL buffer with nonzero size.
  
  Coverity issue.


git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13346 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris committed 2009-05-15 16:13:20 +00:00
1 parent be1650e4ea
commit 935a1433d6
3 files changed
+33 -15

No files matched your search

@@ -496,6 +496,22 @@ int test_header_parsing(void)
su_home_deinit(home);
}
{
char b[8];
TEST(msg_unquoted_e(NULL, 0, "\"\""), 6);
TEST(msg_unquoted_e(b, 0, "\"\""), 6);
TEST(msg_unquoted_e(b, 4, "\"\""), 6);
TEST(msg_unquoted_e(b, 6, "\"\""), 6);
TEST(memcmp(b, "\"\\\"\\\"\"", 6), 0);
TEST(msg_unquoted_e(b, 4, "\""), 4);
memset(b, 0, sizeof b);
TEST(msg_unquoted_e(b, 1, "\"kuik"), 8);
TEST(memcmp(b, "\"\0", 2), 0);
TEST(msg_unquoted_e(b, 3, "\"kuik"), 8);
TEST(memcmp(b, "\"\\\"\0", 4), 0);
TEST(msg_unquoted_e(b, 7, "\"kuik"), 8);
TEST(memcmp(b, "\"\\\"kuik\0", 8), 0);
}
END();
}