Skip to content

Commit

Permalink
fixed invalid memory reads detected by the address sanitizer
Browse files Browse the repository at this point in the history
  • Loading branch information
fbb-git committed Feb 4, 2016
1 parent de8e248 commit fd85f8c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions yodl/VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#define VERSION "3.06.00"
#define YEARS "1996-2015"
#define VERSION "3.07.00"
#define YEARS "1996-2016"
9 changes: 9 additions & 0 deletions yodl/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
yodl (3.07.00)

* Hanno B\"ock reported an invalid memory read found by the address sanitizer
(using -fsanitize=address). Fixed in this release. The address santizer
also reported some memory leaks which are not nice, but their fix will
probably take some more time.

-- Frank B. Brokken <f.b.brokken@rug.nl> Thu, 04 Feb 2016 22:35:44 +0100

yodl (3.06.00)

* The title, author, date and affiliation elements in html document headers
Expand Down
5 changes: 4 additions & 1 deletion yodl/src/queue/queuepush.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ void queue_push(register Queue *qp, size_t extra_length, char const *info)

if (extra_length > available_length)
{
size_t original_length = memory_length;

/* enlarge the buffer: */
memory_length += extra_length - available_length + BLOCK_QUEUE;

cp = new_memory(memory_length, sizeof(char));

if (message_show(MSG_INFO))
Expand All @@ -48,7 +51,7 @@ void queue_push(register Queue *qp, size_t extra_length, char const *info)
}
else /* q as one block */
{
memcpy(cp, qp->d_memory, memory_length);/* cp existing buffer */
memcpy(cp, qp->d_memory, original_length);/* cp existing buffer */
qp->d_read = cp + (qp->d_read - qp->d_memory);
qp->d_write = cp + (qp->d_write - qp->d_memory);
}
Expand Down

0 comments on commit fd85f8c

Please sign in to comment.