Commit Graph

80 Commits

Author SHA1 Message Date
Marty E. Plummer 12dc1bef1f build: do not install config.h
'config.h' is meant to be a convenience header to be #included at build
time, but not installed. Installing it can cause a host of problems for
various other projects (for instance, attempting to build u-boot from
source while another project's 'config.h' exists in the compiler search
path will cause build failures similar to:
https://github.com/pepe2k/u-boot_mod/issues/148

Further, I've changed '#include <config.h>' to '#include "config.h"',
which should constrain the search path to the current build directories,
so if another package with a bugged build has this file installed, it
will not cause yaml to miscompile/fail.

If you have a file `/usr/include/config.h` on your filesystem, query
your package manager to find out what package owns it, and file a bug
report against it with your distro maintainers.

Signed-off-by: Marty E. Plummer <hanetzer@protonmail.com>
2018-07-19 14:49:53 -07:00
Tina Müller df5c05e120 Fix unconditional yaml_free()
Thanks to @tlsa for spotting this
2018-07-18 23:36:58 +02:00
Reini Urban f033001839 fix version_directive memory leak
detected by coverity
2018-07-18 22:10:31 +02:00
Florian Weimer 96a49a1d9c yaml_stack_extend: guard against integer overflow 2018-07-18 21:56:11 +02:00
Reini Urban 5b8859f728 fix C++ g++-6 errors
yaml_emitter_write_indicator const char *indicator
2018-07-18 21:26:40 +02:00
Reini Urban 551ad48994 fix clang -Wlogical-op warnings
Commit amended by @perlpunk after suggestion from @tlsa
2018-07-18 21:22:15 +02:00
Reini Urban 75eddf785f fix C++-compat error
we cannot malloc to an anon struct in C++.
typedef yaml_anchors_t
2018-07-17 23:08:09 +02:00
Tina Müller 20496ee288 Allow colons in plain scalars inside flow collections
This is a followup to #28

See http://yaml.org/spec/1.1/#nb-plain-char(c) and the following
productions.

This commit will allow `[http://example]`, but still fail for:
- `[:foo]`
- `[foo:]`

See https://gist.github.com/perlpunk/de2c631a7b0e9002de351a680eadb573
for all the relevant cases where this change applies.
2018-06-30 15:12:39 -07:00
Reini Urban 31bb2aaa34 Fix yaml_document_delete
Remove unneeded context, which is not set in any macro.
2018-06-30 14:47:34 -07:00
whiteUnicorn 4657431277 Fix typo error
nessesary to necessary
2018-06-30 14:47:34 -07:00
Tina Müller baf636a74b The closing single quote needs to be indented...
if it's on its own line.

```
% cd libyaml
% echo "+STR
+DOC
+SEQ
=VAL '\\\n
-SEQ
-DOC
-STR" | ./tests/run-emitter-test-suite
- '

'
% # fix
% make
...

% echo "+STR
+DOC
+SEQ
=VAL '\\\n
-SEQ
-DOC
-STR" | ./tests/run-emitter-test-suite
- '

  '
```
2018-06-30 14:47:33 -07:00
Viktor Szakats 2e849b3651 Fix token name typos in comments 2018-06-30 14:47:25 -07:00
Tina Müller 56f4b17221 Don't emit document-end marker at the end of stream
(only when explicitly requested)

@jrtc27++ for the patch.

See #60
2018-06-30 00:16:34 +02:00
Tina Müller 8ee83c0da2 Revert removing of open_ended after top level plain scalar
See also issue #60

Revert "This code is not needed and breaks tests"

This reverts commit 56400d976a.
2018-06-29 21:44:19 +02:00
Roger Peppe 01f3a87861 Remove need for PTRDIFF_MAX
It's just as easy to calculate the maximum value directly.
2018-01-11 09:36:31 -08:00
Reini Urban fc2dd942fc Fixed most compiler warnings -Wall -Wextra
repro:
  CFLAGS="-Wall -Wextra -Wunused-parameter -Wc++-compat" ./configure && make

which we use for perl, and libyaml is now included in cperl.
Tested with gcc-5 and clang-3.7

There are still a tons of format warnings (%d on 64bit) in
example-deconstructor.c which I skipped.
2018-01-08 10:44:25 -08:00
Andy Grundman 2b8b563222 Compilation fix for Solaris
From https://github.com/ingydotnet/yaml-libyaml-pm/issues/24
2018-01-08 10:37:15 -08:00
Marty E. Plummer a70c7f36cb add -no-undefined to src/Makefile.am
Without this change building a dll with the mingw-w64 toolchain is
impossible. All tests from make test-all succeed on native linux
(Gentoo amd64 glibc default/linux/amd64/17.1/desktop gcc-7.2.0)

Signed-off-by: Marty E. Plummer <hanetzer@protonmail.com>
2018-01-06 22:43:18 -06:00
Tina Müller 5672b16382 Define PTRDIFF_MAX if it's not in stdint.h
Seems to be the case on HP-UX
2017-12-23 01:48:59 +01:00
Tina Müller 6cc8b63ff7 Forbid escaped singlequote in doublequotes
See also issue #68
2017-12-02 22:26:25 +01:00
Ian Cordasco 6bbc217fc7 Fix unitialized value crash found by OSS Fuzz
Google's OSS Fuzz project found input for libyaml that was capable of
triggering an uninitialized value crash.

Patch provided by Alex Gaynor
2017-05-13 18:27:08 -05:00
Ian Cordasco b6cc3a689d Add -Wall to list of compile flags
Let's start warning on everything and we'll clean the warnings up as we
go along.
2016-12-29 15:55:41 -06:00
Leo Arias 37c92e06f8 Fix misspell: preceed
https://en.wiktionary.org/wiki/preceed
2016-12-07 06:13:08 -06:00
SHIBATA Hiroshi 986dbde7b3 Removed trailing-whitespaces 2016-11-23 16:15:19 -06:00
SHIBATA Hiroshi bdf4d192d0 Picked typofix from Ruby's Psych parser
See also
https://github.com/ruby/psych/commit/66fb7fb77533d0606748940288858794752d95cb
2016-11-23 10:09:18 -06:00
Ingy döt Net 6db69c72d4 spec-1.2 rule [53]
Support "\/" for JSON compatability.
2016-10-06 10:03:48 -07:00
Ingy döt Net 56400d976a This code is not needed and breaks tests
This code was disabled in Perl binding for breaking tests.

Kirill said on IRC:

< rz> ingy: i'm not sure why i set open_ended in yaml_emitter_write_plain_scalar
2016-09-21 11:17:39 -07:00
Kirill Simonov 686b2d8507 Fixed segfault in yaml_string_write_handler. 2016-06-05 13:02:56 -05:00
Kirill Simonov 946596172d Removed invalid simple key assertion (thank to Jonathan Gray). 2014-11-28 11:55:12 -06:00
Kirill Simonov d1003a9d40 Fixed heap overflow in yaml_parser_scan_uri_escapes (Thanks Ivan Fratric of the Google Security Team). 2014-03-26 07:03:17 -05:00
Kirill Simonov 303b4558ef Manually define PTRDIFF_MAX for VS C compiler. 2014-02-03 21:41:19 -06:00
Kirill Simonov 1ef1171721 Forgot to set the error state. 2014-02-03 00:44:03 -06:00
Kirill Simonov c9479c77ed Limit input size to SIZE_MAX/2. 2014-02-03 00:26:46 -06:00
Kirill Simonov c201bf64fa Guard against overflows in indent and flow_level. 2014-02-02 23:41:44 -06:00
Kirill Simonov 2d94fc5002 Prevent node index overflow (Reported by Florian Weimer). 2014-02-02 20:53:10 -06:00
Kirill Simonov f56726b996 Fixed invalid size_t->int cast (Thank to Florian Weimer). 2014-01-12 21:44:24 -06:00
Kirill Simonov 3b160b6028 Fixed pointer arithmetic overflow when calculating the position of a potential simple key (#156, thank to ppelletier(at)oblong(dot)com). 2010-10-11 06:41:03 +00:00
Kirill Simonov bbaaf49bc4 Fixed a bug which prevented an empty mapping from being used as a simple key (#150, thank to spitzak(at)rhythm(dot)com). 2010-10-11 06:29:07 +00:00
Kirill Simonov 1893dabd78 Do not update the raw buffer when not necessary (fixes #123). 2009-08-29 21:26:11 +00:00
Kirill Simonov 252c575a5c Fixed non-ANSI initializations (fixes #115). 2009-02-23 19:59:19 +00:00
Kirill Simonov c70abc4d0d Always use lower case in error messages. 2008-12-28 20:46:22 +00:00
Kirill Simonov 561ca6de7b Fixed emitting folded scalars with trailing breaks; Forced emitting of a document end indicator when there is a possibility of ambiguous parsing. 2008-12-27 19:14:00 +00:00
Kirill Simonov 40cc5d1517 Rewritten whitespace detection in the scalar analyzer and block scalar writers (ported from PyYAML). 2008-12-27 12:14:54 +00:00
Kirill Simonov 6be8109b82 Fixed grammar in error messages (from YAML::XS::LibYAML). 2008-07-31 20:41:02 +00:00
Kirill Simonov 5e52c31904 Fixed a problem when the DOCUMENT-END event is not emitted until the beginning of the next document is available. Fixed #51. Thanks edward(at)sweetbytes.net for the bug report. 2007-04-17 17:39:54 +00:00
Kirill Simonov c9b74def08 Eliminate some warnings and add more doxygen definitions. 2007-01-08 18:33:55 +00:00
Kirill Simonov 071329aef5 Fix a bug in the emitter introduced while fixing warnings for VC6. 2007-01-08 12:27:08 +00:00
Kirill Simonov 0174ed6e0a Add win32 fixes and project files for VC6. 2007-01-07 22:51:10 +00:00
Kirill Simonov e27a3c886e Add functions for constructing, parsing and emitting YAML documents. 2007-01-07 20:11:16 +00:00
Kirill Simonov a907bf857a Add const qualifier for yaml_parser_set_input_string parameter input. 2006-12-11 19:33:21 +00:00