Skip to content

Commit

Permalink
Catch error when parsing address book rows. This should fix the segfa…
Browse files Browse the repository at this point in the history
…ult reported in #98
  • Loading branch information
staaldraad committed Jun 21, 2019
1 parent 297adf9 commit f126b9e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ruler.go
Original file line number Diff line number Diff line change
Expand Up @@ -639,9 +639,12 @@ func abkDump(c *cli.Context) error {
columns := make([]mapi.PropertyTag, 2)
columns[0] = mapi.PidTagDisplayName
columns[1] = mapi.PidTagSMTPAddress
rows, _ := mapi.QueryRows(100, []byte{}, columns) //pull first 255 entries
rows, err := mapi.QueryRows(100, []byte{}, columns) //pull first 255 entries
if err != nil {
return fmt.Errorf("Couldn't read address book: %s", err)
}

for k := 0; k < int(rows.RowCount); k++ {
for k := 0; k < int(rows.RowCount); k++ {
if len(rows.RowData[k].AddressBookPropertyValue) == 2 {
disp := utils.FromUnicode(rows.RowData[k].AddressBookPropertyValue[0].Value)
email := utils.FromUnicode(rows.RowData[k].AddressBookPropertyValue[1].Value)
Expand Down

0 comments on commit f126b9e

Please sign in to comment.