After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 784912 - [PATCH] mdvi-lib: Fix two compilation warnings
[PATCH] mdvi-lib: Fix two compilation warnings
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: backends
git master
Other All
: Normal enhancement
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-07-13 15:12 UTC by astian
Modified: 2017-08-17 11:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
mdvi-lib: Fix two compilation warnings (955 bytes, patch)
2017-07-13 15:12 UTC, astian
none Details | Review
mdvi-lib: Fix compilation warning (bad prototype) (1.04 KB, patch)
2017-07-20 03:01 UTC, astian
committed Details | Review
mdvi-lib: Fix compilation warning (const-correctness) (1.10 KB, patch)
2017-07-20 03:02 UTC, astian
committed Details | Review

Description astian 2017-07-13 15:12:23 UTC
Created attachment 355525 [details] [review]
mdvi-lib: Fix two compilation warnings

They are:
  - incorrect function prototype, and
  - const char accessed through a char pointer.
Comment 1 Bastien Nocera 2017-07-19 16:05:12 UTC
Review of attachment 355525 [details] [review]:

Can you please split this up into 2 patches? In the commit message, also include the warning message from the compiler.

You should investigate git-bz to attach patches, see https://wiki.gnome.org/Git/WorkingWithPatches
Should make it easier to contribute multiple patches without too much manual work :)
Comment 2 astian 2017-07-20 03:01:11 UTC
Created attachment 355999 [details] [review]
mdvi-lib: Fix compilation warning (bad prototype)
Comment 3 astian 2017-07-20 03:02:18 UTC
Created attachment 356000 [details] [review]
mdvi-lib: Fix compilation warning (const-correctness)
Comment 4 astian 2017-07-20 03:26:19 UTC
(In reply to Bastien Nocera from comment #1)
> Review of attachment 355525 [details] [review] [review]:
>
> Can you please split this up into 2 patches? In the commit message, also
> include the warning message from the compiler.

Done.

Note:  Prompted by your mention in the other report that libgd is a separate
project, I went looking for an upstream "mdvi-lib".  I found this [0], which
apparently hasn't been updated in 16 years.  Given that, it's questionable
whether it should be considered an upstream or not, but the interesting thing
is that these 2 bugs are in fact fixed in that 16-years old codebase [1], so
evidently Evince's import is even older!

  0: https://sourceforge.net/projects/mdvi/
  1: http://mdvi.cvs.sourceforge.net/viewvc/mdvi/mdvi/lib/fontmap.c?view=annotate
     The bad prototype was fixed, the code for the bad pointer type is
     disabled.

In the Git log I see that Evince has fixed a few vulnerabilities (last one in
2011); I wonder if this is why nobody has attempted to merge the two yet...

> You should investigate git-bz to attach patches, see
> https://wiki.gnome.org/Git/WorkingWithPatches
> Should make it easier to contribute multiple patches without too much manual
> work :)

Thanks for the heads up, I will take a look later.  Sidenote: the script seems
to be available only via insecure protocols.  If it's commonly used by Gnome
people it would be good if a known-good mirror could be set up on something
less trivially MITM'able.
Comment 5 Bastien Nocera 2017-07-20 05:05:54 UTC
Review of attachment 355999 [details] [review]:

Looks fine.
Comment 6 Bastien Nocera 2017-07-20 05:29:23 UTC
Review of attachment 356000 [details] [review]:

Sure.
Comment 7 Bastien Nocera 2017-07-20 05:36:42 UTC
(In reply to astian from comment #4)
> (In reply to Bastien Nocera from comment #1)
> > Review of attachment 355525 [details] [review] [review] [review]:
> >
> > Can you please split this up into 2 patches? In the commit message, also
> > include the warning message from the compiler.
> 
> Done.
> 
> Note:  Prompted by your mention in the other report that libgd is a separate
> project, I went looking for an upstream "mdvi-lib".  I found this [0], which
> apparently hasn't been updated in 16 years.  Given that, it's questionable
> whether it should be considered an upstream or not, but the interesting thing
> is that these 2 bugs are in fact fixed in that 16-years old codebase [1], so
> evidently Evince's import is even older!
> 
>   0: https://sourceforge.net/projects/mdvi/
>   1:
> http://mdvi.cvs.sourceforge.net/viewvc/mdvi/mdvi/lib/fontmap.c?view=annotate
>      The bad prototype was fixed, the code for the bad pointer type is
>      disabled.
> 
> In the Git log I see that Evince has fixed a few vulnerabilities (last one in
> 2011); I wonder if this is why nobody has attempted to merge the two yet...

I looked for the upstream, but couldn't find it. If you want to give a try to reconciling those two, that would be great!

> > You should investigate git-bz to attach patches, see
> > https://wiki.gnome.org/Git/WorkingWithPatches
> > Should make it easier to contribute multiple patches without too much manual
> > work :)
> 
> Thanks for the heads up, I will take a look later.  Sidenote: the script
> seems
> to be available only via insecure protocols.  If it's commonly used by Gnome
> people it would be good if a known-good mirror could be set up on something
> less trivially MITM'able.

It's also in git, and in plenty of mirrors on GitHub if you're worried.
Comment 8 astian 2017-07-23 18:04:48 UTC
comment #7:
>> Note:  Prompted by your mention in the other report that libgd is a separate
>> project, I went looking for an upstream "mdvi-lib".  I found this [0], which
>> apparently hasn't been updated in 16 years.  Given that, it's questionable
>> whether it should be considered an upstream or not, but the interesting thing
>> is that these 2 bugs are in fact fixed in that 16-years old codebase [1], so
>> evidently Evince's import is even older!
>>
>>   0: https://sourceforge.net/projects/mdvi/
>>   1:
>> http://mdvi.cvs.sourceforge.net/viewvc/mdvi/mdvi/lib/fontmap.c?view=annotate
>>      The bad prototype was fixed, the code for the bad pointer type is
>>      disabled.
>>
>> In the Git log I see that Evince has fixed a few vulnerabilities (last one in
>> 2011); I wonder if this is why nobody has attempted to merge the two yet...
>
>I looked for the upstream, but couldn't find it. If you want to give a
>try to reconciling those two, that would be great!

So I took a closer look and now I see that those changes I mentioned are
only in the project's CVS repository, and apparently haven't been
released.  The last tarball release on that site seems to be much closer
to what evince is based on.  So I take back my statement about the
relative age of Evince's import.

Given that it's unreleased code and that I know nothing about DVI, I
will pass.

---

Off-topic:

>>> You should investigate git-bz to attach patches, see
>>> https://wiki.gnome.org/Git/WorkingWithPatches
>>> Should make it easier to contribute multiple patches without too much manual
>>> work :)
>>
>> Thanks for the heads up, I will take a look later.  Sidenote: the script
>> seems
>> to be available only via insecure protocols.  If it's commonly used by Gnome
>> people it would be good if a known-good mirror could be set up on something
>> less trivially MITM'able.
>
> It's also in git, and in plenty of mirrors on GitHub if you're worried.

"git://" is an insecure protocol.  I suppose you meant that one could take the
HEAD hash in the "git://" upstream and compare it to the HEAD hash of some
"https://" github mirror, but...

> and in plenty of mirrors on GitHub if you're worried.

Maybe my search-fu is weak today but I can't find a single one.  There
are plenty of derivatives, though.  The closest one is this [0], 2
commits behind.  Close enough for me.

  0: https://github.com/ari3s/git-bz/commits/master

Still, it should be on gnome infrastructure.

Though I guess Gnome concerns are probably focused elsewhere given that
*the whole fscking jhbuild checkout* is (by default and unless you are
careful) over an insecure channel.

Thanks.
Comment 9 Tobias Mueller 2017-08-17 11:09:00 UTC
Attachment 355999 [details] pushed as 12fa68e - mdvi-lib: Fix compilation warning (bad prototype)
Attachment 356000 [details] pushed as e3dccc1 - mdvi-lib: Fix compilation warning (const-correctness)