summaryrefslogtreecommitdiff
path: root/src/gd_xbm.c
Commit message (Collapse)AuthorAgeFilesLines
* drop redundant strcasecmp defineMike Frysinger2021-03-031-4/+0
| | | | The common gd.h already provides this.
* Fix #501: Uninitialized read in gdImageCreateFromXbm (CVE-2019-11038)Jonas Meurer2019-09-021-1/+5
| | | | | | | | | | | | Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2019-11038 Bug-Debian: https://bugs.debian.org/929821 Bug: https://github.com/libgd/libgd/issues/501 We have to ensure that `sscanf()` does indeed read a hex value here, and bail out otherwise. Original patch by Christoph M. Becker <cmbecker69@gmx.de> for PHP libgd ext. https://git.php.net/?p=php-src.git;a=commit;h=ed6dee9a198c904ad5e03113e58a2d2c200f5184
* clean up trailing whitespace/newlinesMike Frysinger2018-06-211-1/+1
| | | | | This is preparation for adding some linting checks for new commits from people. Shouldn't be any functional changes here (tests still pass!).
* Add a test for reading X10 bitmap filesChristoph M. Becker2017-01-211-5/+19
| | | | | We also improve the related documentation, which didn't mention yet which X bitmap formats are supported.
* Fix #109: XBM reading fails with printed errorChristoph M. Becker2017-01-201-1/+1
| | | | | When calculating the number of required bytes of an XBM image, we have to take the line padding into account.
* Mark up code examples with (start|end code)Christoph M. Becker2016-08-231-7/+10
| | | | | | This makes the code better readable in the sources, and we get syntax highlighting in the generated HTML wherever we want it (i.e. not necessarily always as with `-hl all`).
* Group the supported image formats in the menu of the docsChristoph M. Becker2016-08-141-0/+6
| | | | | To do so we have to add Menu.txt to the project, but we can ignore Languages.txt and Topics.txt, at least for now.
* Document all BGD_DECLARE'd functionsChristoph M. Becker2016-07-201-0/+3
| | | | | We add only minimal documentation comments for now, but at least that lets Natural Docs add the function prototypes to the documentation.
* Fix #170: XBM images require width to be multiple of 8Christoph M. Becker2016-06-161-1/+1
| | | | | We remove this limitation by fixing the underlying implementation bug, and add a respective regression test to the suite.
* xbm: avoid stack overflow (read) with large names #211Mike Frysinger2016-05-141-7/+27
| | | | | | | | | | We use the name passed in to printf into a local stack buffer which is limited to 4000 bytes. So given a large enough value, lots of stack data is leaked. Rewrite the code to do simple memory copies with most of the strings to avoid that issue, and only use stack buffer for small numbers of constant size. This closes #211.
* Started importing the old manual into Naturaldocs comments.Chris Reuter2014-01-071-2/+35
| | | | | | | | | | | | | | | | This changeset imports documention for gdImage to gdImagePng*() into Natural Docs. Documention is based on the text of the original manual, version 2.0.36 but adapted to better suit the format. Subsequent changesets will introduce docs for subsequent manual entries. naturaldocs, when present, is invoked by bootstrap.sh. The completed manual will be in docs/naturaldocs/html/index.html. It can also be explicitly invoked by running docs/naturaldocs/run_docs.sh. This change also removed docs/naturaldocs/project/Menu.txt, since it currently contains no non-generated content and is prone to introduce noise into the changeset.
* fix warning: implicit declaration of function ‘isupper’ ↵Takeshi Abe2013-04-241-0/+1
| | | | [-Wimplicit-function-declaration] etc.
* fix windows buildPierre Joye2013-04-231-0/+4
|
* gd_xbm: fix fortify warningMike Frysinger2013-04-221-1/+1
| | | | | | | | | | | | | | | | | When glibc fortify is enabled, we get this warning: gd_xbm.c: In function 'gdCtxPrintf': gd_xbm.c:150:2: warning: passing argument 1 of 'vsnprintf' from incompatible pointer type [enabled by default] len = vsnprintf(&buf, sizeof(buf)-1, format, args); ^ In file included from /usr/include/stdio.h:937:0, from gd_xbm.c:5: /usr/include/bits/stdio2.h:74:42: note: expected 'char * __restrict__' but argument is of type 'char (*)[4096]' __NTH (vsnprintf (char *__restrict __s, size_t __n, ^ Since &buf and buf are in practice the same pointer with arrays like this, drop the & to fix the warning.
* Merge PHP libgd Xbm codeOndřej Surý2013-04-221-0/+215