Bug#833085: libeb16: return value assigned to variable of wrong type

2016-07-31 Thread paulownia
Package: libeb16
Version: 4.4.3-10
Tags: patch
Severity: minor

[Resent since previous report hasn't appeared on BTS]
In the function zio_unzip_slice_sebxa() in zio.c, the signed return
value of calls to zio_read_raw() is assigned to an unsigned variable
of type size_t; as a result errors (signaled by rtn value -1) may go
undetected.

Patch attached.
--- a/eb/zio.c
+++ b/eb/zio.c
@@ -1827,7 +1827,7 @@ zio_unzip_slice_sebxa(Zio *zio, char *out_buffer)
 {
 char in_buffer[ZIO_SEBXA_SLICE_LENGTH];
 unsigned char *in_buffer_p;
-size_t in_read_rest;
+ssize_t in_read_rest;
 unsigned char *out_buffer_p;
 size_t out_length;
 int compression_flags[8];


Bug#776425: ebview: dpkg-buildflags-missing warning whenbuilding ebview-client

2015-07-31 Thread paulownia
gregor herrmann  writes:
> I just tried and: with or without your patch

Thank you for looking into this issue.

> - the configure call is identical

This is expected. cdbs already ensures that configure is called
with the correct parameters, the patch doesn't change anything
here.

> - the blhc messages are the same

I tried it out using ebview 0.3.6.2-1.4 and blhc version
0.04+20140813+gitac2b8ce-1:

ebview 0.3.6.2-1.4 without the patch:

$ blhc ebview_0.3.6.2-1.4_i386.build
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): cc -g -O2 -fstack-protector-strong 
-Wformat -Werror=format-security -Wall -o /tmp/ebview-0.3.6.2/src/ebview-client 
/tmp/ebview-0.3.6.2/src/ebview-client.c
LDFLAGS missing (-Wl,-z,relro): cc -g -O2 -fstack-protector-strong -Wformat 
-Werror=format-security -Wall -o /tmp/ebview-0.3.6.2/src/ebview-client 
/tmp/ebview-0.3.6.2/src/ebview-client.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): cc -g -O2 -fstack-protector-strong 
-Wformat -Werror=format-security -Wall -o /tmp/ebview-0.3.6.2/src/ebview-client 
/tmp/ebview-0.3.6.2/src/ebview-client.c
LDFLAGS missing (-Wl,-z,relro): cc -g -O2 -fstack-protector-strong -Wformat 
-Werror=format-security -Wall -o /tmp/ebview-0.3.6.2/src/ebview-client 
/tmp/ebview-0.3.6.2/src/ebview-client.c

ebview 0.3.6.2-1.4 with patch:

$ blhc ebview_0.3.6.2-1.4p7764251_i386.build
(no output)

What output are you seeing from blhc?


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#777837: Patch for GCC5 build issue

2015-07-17 Thread paulownia
> Here's a fix for the GCC 5 build issue. I added "extern" to
> inline function in jcode.c. The package builds and links with GCC 5 with
> this change.

Alternatively, simply get rid of the inline declaration. All the calls
to isjisp are in different translation units so they never get inlined
anyway.

Patch:

--- a/src/jcode.c
+++ b/src/jcode.c
@@ -275,7 +275,7 @@ gchar *iconv_convert2(const gchar *icode, const gchar 
*ocode, const gchar *orig)
return(result);
 }
 
-inline gboolean isjisp(const gchar *buff){
+gboolean isjisp(const gchar *buff){
 g_assert(buff != NULL);
 
 if((buff[0] >= 0x21) && (buff[0] <= 0x74) &&
--- a/src/jcode.h
+++ b/src/jcode.h
@@ -31,7 +31,7 @@ enum {
 
 gchar *iconv_convert(const gchar *icode, const gchar *ocode, const gchar 
*inbuf);
 gchar *iconv_convert2(const gchar *icode, const gchar *ocode, const gchar 
*orig);
-inline gboolean isjisp(const gchar *buff);
+gboolean isjisp(const gchar *buff);
 gboolean iseuckanji(const guchar *buff);
 gboolean iseuchiragana(const guchar *buff);
 gboolean iseuckatakana(const guchar *buff);


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#748030: Parameter declarations of function make_missing_directory differ in signedne

2015-01-29 Thread paulownia
tags 748030 + patch
stop

The correct type is actually mode_t.

Patch:

--- a/libebutils/makedir.h
+++ b/libebutils/makedir.h
@@ -33,10 +33,11 @@
 #include "config.h"
 #endif
 
+#include 
 
 /*
  * Function declarations.
  */
-int make_missing_directory(const char *, int);
+int make_missing_directory(const char *, mode_t);
 
 #endif /* not MAKEDIR_H */


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#776602: eb: fix format string warning [-Wformat-extra-args]

2015-01-29 Thread paulownia
Package: src:eb
Version: 4.4.3-7
Tags: patch
Severity: minor

This patch fixes a (harmless) format string warning for eb (too many
arguments for format string).

--- a/ebinfo/ebinfo.c
+++ b/ebinfo/ebinfo.c
@@ -371,7 +371,7 @@ output_information(const char *book_path, int multi_flag)
return_code = error_code;
continue;
}
-   printf(_("  title: "), title);
+   fputs(_("  title: "), stdout);
fputs_eucjp_to_locale(title, stdout);
fputc('\n', stdout);
 
@@ -567,7 +567,7 @@ output_multi_information(EB_Book *book)
return_code = error_code;
continue;
}
-   printf(_("title: "), search_title);
+   fputs(_("title: "), stdout);
fputs_eucjp_to_locale(search_title, stdout);
fputc('\n', stdout);


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#715855: libeb16: patch to fix #715855 and other mayhem-detected crashes

2015-01-29 Thread paulownia
reassign 715855 libeb16
tags 715855 + patch
stop

The three bugs in libeb tools detected by "Mayhem" all have the same
cause: The function url_parts_parse() in eb/urlparts.c performs a
NULL-pointer dereference when trying to parse certain ill-formed ebook
URLs.

`hostport' is one of several local variables that url_parts_parse
initalises to NULL and then tries to match to particular parts of the
URL string. However, if the url string contains "//" and ends in "@",
the 'hostport' pointer is dereferenced even though it still has the
value NULL, which is causing the segfault.

You can reproduce the crash easily by running
$ ebfont "EBNET:// @"
(or passing a similar book URL to any of the other eb tools)

The following patch wraps the code that causes the NULL-pointer
dereference with a test that (hostport != NULL). The URL parsing code
in url_parts_parse() looks a little fragile though, there may be other
bugs.

I am reassigning the bug to libeb16, because url_parts_parse() is run
as a consequence of calling eb_bind(), which is part of the library
API.

Here is the patch:

--- a/eb/urlparts.c
+++ b/eb/urlparts.c
@@ -355,20 +355,22 @@ url_parts_parse(URL_Parts *parts, const char *url)
 * Get host and port.
 * IPv6 address is enclosed in `[' and `]'.
 */
-   if (*hostport == '[') {
-   right_bracket = strchr(hostport + 1, ']');
-   if (right_bracket == NULL)
-   separator = NULL;
-   else {
-   if (*(right_bracket + 1) == ':'
-   || *(right_bracket + 1) == '\0') {
-   hostport++;
-   *right_bracket = '\0';
+   if (hostport != NULL) {
+   if (*hostport == '[') {
+   right_bracket = strchr(hostport + 1, ']');
+   if (right_bracket == NULL)
+   separator = NULL;
+   else {
+   if (*(right_bracket + 1) == ':'
+   || *(right_bracket + 1) == '\0') {
+   hostport++;
+   *right_bracket = '\0';
+   }
+   separator = strchr(right_bracket + 1, ':');
+   }
+   } else {
+   separator = strchr(hostport, ':');
}
-   separator = strchr(right_bracket + 1, ':');
-   }
-   } else {
-   separator = strchr(hostport, ':');
}
 
if (separator != NULL) {


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#715855: libeb16: patch for #715855 (resent)

2015-01-29 Thread paulownia
[ I am resending the mail with the patch as the BTS has interpreted
  the first one as a control message and is hiding it; apologies for
  the confusion. ]

The three bugs in libeb tools detected by "Mayhem" all have the same
cause: The function url_parts_parse() in eb/urlparts.c performs a
NULL-pointer dereference when trying to parse certain ill-formed ebook
URLs.

`hostport' is one of several local variables that url_parts_parse
initalises to NULL and then tries to match to particular parts of the
URL string. However, if the url string contains "//" and ends in "@",
the 'hostport' pointer is dereferenced even though it still has the
value NULL, which is causing the segfault.

You can reproduce the crash easily by running
$ ebfont "EBNET:// @"
(or passing a similar book URL to any of the other eb tools)

The following patch wraps the code that causes the NULL-pointer
dereference with a test that (hostport != NULL). The URL parsing code
in url_parts_parse() looks a little fragile though, there may be other
bugs.

I am reassigning the bug to libeb6, because url_parts_parse() is run
as a consequence of calling eb_bind(), which is part of the library
API.

Here is the patch:

--- a/eb/urlparts.c
+++ b/eb/urlparts.c
@@ -355,20 +355,22 @@ url_parts_parse(URL_Parts *parts, const char *url)
 * Get host and port.
 * IPv6 address is enclosed in `[' and `]'.
 */
-   if (*hostport == '[') {
-   right_bracket = strchr(hostport + 1, ']');
-   if (right_bracket == NULL)
-   separator = NULL;
-   else {
-   if (*(right_bracket + 1) == ':'
-   || *(right_bracket + 1) == '\0') {
-   hostport++;
-   *right_bracket = '\0';
+   if (hostport != NULL) {
+   if (*hostport == '[') {
+   right_bracket = strchr(hostport + 1, ']');
+   if (right_bracket == NULL)
+   separator = NULL;
+   else {
+   if (*(right_bracket + 1) == ':'
+   || *(right_bracket + 1) == '\0') {
+   hostport++;
+   *right_bracket = '\0';
+   }
+   separator = strchr(right_bracket + 1, ':');
+   }
+   } else {
+   separator = strchr(hostport, ':');
}
-   separator = strchr(right_bracket + 1, ':');
-   }
-   } else {
-   separator = strchr(hostport, ':');
}
 
if (separator != NULL) {


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#776436: fonts-vlgothic: wrong metrics for several symbols (full- instead of half-width)

2015-01-27 Thread paulownia
Package: fonts-vlgothic
Version: 20141206-1

The character widths of several (latin1) symbols in VL Gothic seem to
be incorrect, they are full-width when they should be half-width. The
following characters are affected, there may be more:

¤ U+00a4 CURRENCY SIGN
§ U+00a7 SECTION SIGN
¨ U+00a8 DIAERESIS
© U+00a9 COPYRIGHT SIGN
® U+00ae REGISTERED SIGN
° U+00b0 DEGREE SIGN
± U+00b1 PLUS-MINUS SIGN
² U+00b2 SUPERSCRIPT TWO
³ U+00b3 SUPERSCRIPT THREE
´ U+00b4 ACUTE ACCENT
¶ U+00b6 PILCROW SIGN
· U+00b7 MIDDLE DOT
¹ U+00b9 SUPERSCRIPT ONE
º U+00ba MASCULINE ORDINAL INDICATOR
¼ U+00bc VULGAR FRACTION ONE QUARTER
½ U+00bd VULGAR FRACTION ONE HALF
¾ U+00be VULGAR FRACTION THREE QUARTERS
¿ U+00bf INVERTED QUESTION MARK
× U+00d7 MULTIPLICATION SIGN
÷ U+00f7 DIVISION SIGN


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#776425: ebview: dpkg-buildflags-missing warning when building ebview-client

2015-01-27 Thread paulownia
Package: ebview
Version: 0.3.6.2-1.3
Tags: patch

CPPFLAGS and LDFLAGS are currently not passed to the compiler when
building ebview-client; I think this is the cause of the
dpkg-buildflags-missing warning reported by the build log scanner
 (cdbs handles the
buildflags automatically for everything else).

The following patch fixes this:

--- a/debian/rules
+++ b/debian/rules
@@ -10,7 +10,7 @@ DEB_CONFIGURE_EXTRA_FLAGS := --sysconfdir=/etc
 DEB_MAKE_INSTALL_TARGET := install prefix=$(CURDIR)/debian/ebview/usr
 
 build/ebview::
-   $(CC) $(CFLAGS) -o $(CURDIR)/src/ebview-client 
$(CURDIR)/src/ebview-client.c
+   $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(CURDIR)/src/ebview-client 
$(CURDIR)/src/ebview-client.c
 
 install/ebview::
install -m 755 $(CURDIR)/src/ebview-client 
$(CURDIR)/debian/ebview/usr/bin


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#776394: ebview: Out-of-bounds write causing crashes during full-text search

2015-01-27 Thread paulownia
Package: ebview
Version: 0.3.6.2-1.3
Tags: patch

There's an off-by-one error in ebview which is causing occasional
crashes for me when doing full-text searches (specifically, when
the search strings consist entirely of ascii characters):

The function euc2jis() in src/eb.c doesn't allocate enough space
for its output.

It malloc's (strlen((gchar *) euc_p)*2) bytes, initialises the pointer
jis_p to point to the beginning of the buffer, and then in the
following while loop jis_p is advanced twice each iteration. If the
input string (inbuf) consists entirely of ascii characters, jis_p be
advanced (strlen((gchar *) euc_p)*2) times, and will point past the
end of the buffer; writing the terminating NUL character causes an
out-of-bounds write in this case.

The following patch fixes this:

--- a/src/eb.c
+++ b/src/eb.c
@@ -811,7 +811,7 @@ static gchar *euc2jis(gchar *inbuf){
guchar *jis_p;
 
euc_p = (guchar *) inbuf;
-   jis_p = jisbuf = malloc(strlen((gchar *) euc_p)*2);
+   jis_p = jisbuf = malloc(strlen((gchar *) euc_p)*2+1);
 
while(*euc_p != '\0'){
if(( 0x20 <= *euc_p) && (*euc_p <= 0x7e) && 
(ascii_to_jisx2080_table[*euc_p] != 0x00)){


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#775906: lookup-el: possible alternative upstream

2015-01-21 Thread paulownia
Package: lookup-el
Version: 1.4.1-13
Severity: wishlist

There is a lookup2 project on github/sourceforge.
It seems slightly more active that the official lookup upstream
(although there is still no stable 2.0 version...)

https://lookup2.github.io/
https://github.com/lookup2/lookup2

http://lookup.sourceforge.net/


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#715857: Patch for #715857 (eblook segfaults when HOME unset)

2015-01-21 Thread paulownia
tags 715857 + patch
stop

The cause of this bug is that eblook assumes that the
HOME environment variable is always set: it dereferences
the return value of getenv("HOME") without checking that
it is non-NULL.

You can easily reproduce the segfault by running
$ env -u HOME eblook

The following patch causes eblook to exit cleanly if
HOME is unset, rather than segfault. (This eliminates the
segfault without changing program behavior; alternatively,
it could use getpwent to locate the HOME directory)

--- eblook.c.orig
+++ eblook.c
@@ -133,6 +133,7 @@
 int pclose_pager (FILE *);
 #endif
 
+static char *get_homedir (void);
 char *read_command (char *, size_t, FILE *);
 int excute_command (char *);
 int parse_command_line (char *, char *[]);
@@ -494,7 +495,7 @@
 strcpy (buff, USER_INIT_FILE);
   }
 #else  /* !DOS_FILE_PATH */
-  strcpy (buff, getenv ("HOME"));
+  strcpy (buff, get_homedir ());
   strcat (buff, USER_INIT_FILE + 1);
 #endif /* DOS_FILE_PATH */
 } else {
@@ -519,7 +520,7 @@
strcpy (buff, HIST_FILE);
   }
 #else  /* !DOS_FILE_PATH */
-  strcpy (buff, getenv ("HOME"));
+  strcpy (buff, get_homedir ());
   strcat (buff, HIST_FILE + 1);
 #endif /* DOS_FILE_PATH */
 } else {
@@ -647,6 +648,17 @@
   return 0;
 }
 
+static char *
+get_homedir (void)
+{
+  char *homedir = getenv ("HOME");
+  if (!homedir) {
+xfprintf (stderr, "can't find home directory\n");
+exit (1);
+  }
+  return homedir;
+}
+
 char *
 read_command (command_line, size, stream)
  char *command_line;


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#760547: info documentation not viewable in UTF-8 locale

2014-09-05 Thread paulownia
Package: eblook
Version: 1:1.6.1-13
Tags: patch

The eblook info documentation cannot be displayed properly in a UTF-8
locale. I have tried viewing it using

$ info eblook

at the command line, and in Emacs. In both cases, the characters are
garbled ("mojibake").

Both the .info files and the .texi sources are currently encoded in euc-jp.

According to the texinfo documentation
(https://www.gnu.org/software/texinfo/manual/texinfo/html_node/_0040documentencoding.html),
texinfo doesn't currently support euc-jp input.

I was able to fix the problem by reencoding eblook.texi as UTF-8
(using "iconv -f euc-jp -t utf-8"), and then adding "@documentencoding UTF-8"
to the texinfo header (see patch below).

Makeinfo writes the document encoding into the local variables section
of the info file, therefore the info-viewer should be able to display
the UTF-8 encoded .info file correctly in locales using euc-jp too
(untested).

Patch (to be applied after reencoding eblook.texi as UTF-8):

--- eblook.reencoded-from-euc-jp-to-utf-8.texi
+++ eblook.texi
@@ -3,6 +3,7 @@
 @setfilename eblook.info
 @settitle eblook
 @setchapternewpage off
+@documentencoding UTF-8
 @c %**end of header
 
 @set UPDATED 23 Oct. 2002



--


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#703133: patch for bug#703133

2014-09-04 Thread paulownia
tags 703133 + patch
stop

Here is a patch to fix this bug.

--- a/src/log.c
+++ b/src/log.c
@@ -63,7 +63,7 @@ void log_func(const gchar *file, gint line, LOG_LEVEL level, 
const gchar *messag
 
strcat(format, message);
 
-   va_start(ap, format);
+   va_start(ap, message);
g_vprintf(format, ap);
g_printf("\n");
//g_logv(G_LOG_DOMAIN, level, format, ap);
@@ -73,7 +73,7 @@ void log_func(const gchar *file, gint line, LOG_LEVEL level, 
const gchar *messag
// Show dialog box.
 
if(level <= LOG_MESSAGE){
-   va_start(ap, format);
+   va_start(ap, message);
vsprintf(str, message, ap);
va_end(ap);
 


--


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org