Ticket #1055 (new defect)

Opened 5 years ago

Last modified 5 years ago

vformat expects data to be null-terminated

Reported by: Graham Cobb Owned by: cstender
Priority: normal Milestone:
Component: Format Plugin: vformat Version: 0.38
Severity: normal Keywords:
Cc: dgollub


The vformat format plugin appears to expect data to be null-terminated strings. For example, conv_vcard_to_xmlformat is passed the input buffer address and length but it then just passes the address to vformat_new_from_string which expects it to be null-terminated.

In GPE, I supply report changes with the data and the string length. Thus there is no null terminator. As OSyncData structures include a length, I expect this to be used and not need a null terminator.

I think this is a bug in vformat (and possibly in many other plugins). Alternatively, OpenSync? could decide that the vformat format always requires a null terminator, in which case the bug is in GPE for reporting the change without including the null (do other plugins have the same problem)?

Change History

comment:1 Changed 5 years ago by cstender

  • Cc dgollub added

I also run into this problem [0] and I'm not sure which is the best fix. Some plugins use strlen+1 others use strlen and then in file-sync the data is corrupted. :-/

[0] http://www.nabble.com/invalid-read-of-size---broken-files-in-file-sync-to15962611.html#a15962611

Note: See TracTickets for help on using tickets.