Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ovsdb-idlc: Initialize nonnull string columns for inserted rows.
When a schema column has type "exactly one string", the corresponding struct member has type "char *" and the documented and expected behavior is that the string should always be nonnull. (The code generator even adds a comment /* Always nonnull. */ in the struct definition.) In the case where a value is not available, the string is supposed to be initialized to "" instead of to NULL. However, the IDL code for inserting a new row did not properly initialize the column to "", instead leaving it NULL. This could cause null pointer dereferences in corner cases. This commit fixes the problem. Reported-by: Lance Richardson <[email protected]> Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2016-December/326500.html Signed-off-by: Ben Pfaff <[email protected]> Tested-by: Lance Richardson <[email protected]>
- Loading branch information