Skip to content

Commit

Permalink
Fix two bugs, found in Issue #726
Browse files Browse the repository at this point in the history
* use after free in gplot.c in code only invoked if error has occurred)
* extra ';' in partify.c
  • Loading branch information
DanBloomberg committed Jan 5, 2024
1 parent 7e803e7 commit 699b2a1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
16 changes: 8 additions & 8 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*====================================================================*/

README (version 1.84.0)
File update: 23 Dec 2023
README (version 1.84.1)
File update: 3 Jan 2024
---------------------------

gunzip leptonica-1.84.0.tar.gz
tar -xvf leptonica-1.84.0.tar
gunzip leptonica-1.84.1.tar.gz
tar -xvf leptonica-1.84.1.tar

</pre>

Expand Down Expand Up @@ -117,7 +117,7 @@ <h2> <A NAME="BUILDING">
Libraries, executables and prototypes are easily made, as described below.

When you extract from the archive, all files are put in a
subdirectory 'leptonica-1.84.0'. In that directory you will
subdirectory 'leptonica-1.84.1'. In that directory you will
find a src directory containing the source files for the library,
and a prog directory containing source files for various
testing and example programs.
Expand Down Expand Up @@ -260,7 +260,7 @@ <h2> <A NAME="BUILDING">
make install

Configure also supports building in a separate directory from the
source. Run "/(path-to)/leptonica-1.84.0/configure" and then "make"
source. Run "/(path-to)/leptonica-1.84.1/configure" and then "make"
from the desired build directory.

Configure has a number of useful options; run "configure --help" for
Expand Down Expand Up @@ -1209,8 +1209,8 @@ <h2> <A NAME="CONTENTS">
http://code.google.com/p/leptonica, as well as all versions after 1.60.
These have now been transferred by Egor Pugin to github:
github.com/danbloomberg/leptonica
where all releases (1.42 - 1.84.0) are available; e.g.,
https://github.com/DanBloomberg/leptonica/releases/tag/1.84.0
where all releases (1.42 - 1.84.1) are available; e.g.,
https://github.com/DanBloomberg/leptonica/releases/tag/1.84.1
The more recent releases, from 1.80, are also available at
leptonica.org/download.html
Note that if you are downloading from github, the releases are more
Expand Down
3 changes: 2 additions & 1 deletion src/gplot.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,9 @@ FILE *fp;
/* Write command data to file */
cmdstr = sarrayToString(gplot->cmddata, 1);
if ((fp = fopenWriteStream(gplot->cmdname, "w")) == NULL) {
L_ERROR("stream not opened for command: %s\n", __func__, cmdstr);
LEPT_FREE(cmdstr);
return ERROR_INT_1("cmd stream not opened", cmdstr, __func__, 1);
return 1;
}
fwrite(cmdstr, 1, strlen(cmdstr), fp);
fclose(fp);
Expand Down
2 changes: 1 addition & 1 deletion src/partify.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ l_int32 nbox, i, y1, h1, y2, h2, delta;

if (!boxa)
return ERROR_INT("boxa not defined", __func__, 1);
if ((nbox = boxaGetCount(boxa)) == 0);
if ((nbox = boxaGetCount(boxa)) == 0)
return ERROR_INT("boxa is empty", __func__, 1);
for (i = 0; i < nbox - 1; i++) {
boxaGetBoxGeometry(boxa, i, NULL, &y1, NULL, &h1);
Expand Down
7 changes: 5 additions & 2 deletions version-notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@


<h2 align=center>Version Notes for Leptonica</h2>
<h3 align=center>22 Sept 2021</h3>
<h3 align=center>3 Jan 2024</h3>

<hr>
<h2 align=center> <IMG SRC="moller52.jpg" border=1 ALIGN_MIDDLE> </h2>
Expand All @@ -89,7 +89,10 @@ <h2 align=center> <IMG SRC="moller52.jpg" border=1 ALIGN_MIDDLE> </h2>

<pre>

1.84.1 Not yet released
1.85 not released
* Source files changed: gplot.c, partify.c

1.84.1 Jan 3, 2024
* Remove support for openjpeg versions < 2.1.
* Improve error handling for stringLength() and stringCat(), and
add tests in prog/string_reg.
Expand Down

0 comments on commit 699b2a1

Please sign in to comment.