archive_entry_acl_clear(ae);
free(ws);
+
+ /*
+ * 6. Malformed "default" prefix with no tag field should return
+ * ARCHIVE_WARN, not crash (GitHub issue #2744).
+ * When the ACL text is just "d" or "default" with type DEFAULT,
+ * the parser recognises the default prefix but field[1] is NULL,
+ * which previously caused a NULL-pointer dereference.
+ */
+ archive_entry_acl_clear(ae);
+ assertEqualInt(ARCHIVE_WARN,
+ archive_entry_acl_from_text(ae, "d",
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
+ assertEqualInt(ARCHIVE_WARN,
+ archive_entry_acl_from_text_w(ae, L"d",
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
+ archive_entry_acl_clear(ae);
+ assertEqualInt(ARCHIVE_WARN,
+ archive_entry_acl_from_text(ae, "default",
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
+ assertEqualInt(ARCHIVE_WARN,
+ archive_entry_acl_from_text_w(ae, L"default",
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
+
archive_entry_free(ae);
}