%s in data_object name causes segfault
sb10 opened this issue · comments
Sendu Bala commented
Test with a (non-existent) path "s.txt" works as expected:
jq -n '{collection: "/zone/", data_object: "s.txt"}' | baton-list
2023-03-07T14:35:42Z ERROR Path '/zone/s.txt' does not exist (or lacks access permission)
{"collection": "/zone/", "data_object": "s.txt", "error": {"message": "Path '/zone/s.txt' does not exist (or lacks access permission)", "code": -310000}}
2023-03-07T14:35:42Z WARN Processed 1 items with 1 errors
Test with a (non-existent) path "%s.txt" segfaults:
jq -n '{collection: "/zone/", data_object: "%s.txt"}' | baton-list
2023-03-07T14:35:47Z ERROR Segmentation fault
This is when using /software/sciops/pkgg/baton/4.0.0/bin/baton-list
Keith James commented
This is caused by accidental omission of a printf
format string when handling some errors. In that event, the argument to the format is used as the format string and as it contains an unescaped %
, looks for a further argument, which is NULL.
Keith James commented
Fixed by #269