ubuntu-mate / mate-menu

An Advanced Menu for the MATE Desktop
GNU General Public License v2.0
36 stars 17 forks source link

Empty Menu when a .desktop file contains NUL byte #78

Open saladpanda opened 4 years ago

saladpanda commented 4 years ago

I recently installed Ubuntu Mate 20.04 which uses "Advanced MATE Menu" 20.04.1. Somehow a .desktop file with a NUL byte ended up in my ~/.local/share/applications which lead to the mate menu showing no applications at all.

Hexdump of the bad desktop file:

hexdump -C masterpdf.desktop 
00000000  23 21 2f 75 73 72 2f 62  69 6e 2f 65 6e 76 20 78  |#!/usr/bin/env x|
00000010  64 67 2d 6f 70 65 6e 0a  5b 44 65 73 6b 74 6f 70  |dg-open.[Desktop|
00000020  20 45 6e 74 72 79 5d 0a  54 79 70 65 3d 41 70 70  | Entry].Type=App|
00000030  6c 69 63 61 74 69 6f 6e  0a 4e 61 6d 65 3d 4d 61  |lication.Name=Ma|
00000040  73 74 65 72 20 50 44 46  20 45 64 69 74 6f 72 0a  |ster PDF Editor.|
00000050  45 78 65 63 3d 6d 61 73  74 65 72 70 64 66 65 64  |Exec=masterpdfed|
00000060  69 74 6f 72 0a 00                                 |itor..|
00000066

Removing the last byte from this file or replacing it with a space made all applications reappear.

I think a single faulty .desktop file should not make all other applications disappear but only the one faulty entry at best. I don't even know whether a NUL byte in a .desktop file counts as faulty as e.g. the brisk menu even shows the masterpdf.desktop entry without problems.