Skip to content

TOMLTable causes SIGABORT when parsing invalid table headers #30

@fullmetalsheep

Description

@fullmetalsheep

Hi there,

This is an error originally reported in AeroSpace Repo by andresalvareez

How to Replicate

Please try the following code - note the extra [

  do {
        try TOMLTable(string: "[[[testme]]")
 catch let e {
        // should be caught
    }

It appears to throw a SIGABORT which causes it to never hit the catch blocks either in our code, or in the TOMLTable guard clause

// file - TOMLTable.swift
guard let table = string.withCString({ tableCreateFromString($0, errorPointer) }) else {
	throw TOMLParseError(cTOMLParseError: errorPointer.pointee) // never hits here
}

This causes the program to exit abruptly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions