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 774318 - Epiphany segfault when clicking 'Search the Web for “<text>”'
Epiphany segfault when clicking 'Search the Web for “<text>”'
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Interface
git master
Other FreeBSD
: Normal normal
: ---
Assigned To: Michael Catanzaro
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-11-12 13:03 UTC by Ting-Wei Lan
Modified: 2016-11-12 19:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Improve handling of search the web menu item (9.18 KB, patch)
2016-11-12 19:14 UTC, Michael Catanzaro
committed Details | Review

Description Ting-Wei Lan 2016-11-12 13:03:15 UTC
In src/popup-commands.c, function get_search_term:

  search_term = strchr (text, '\'') + 1;
  search_term[strlen (search_term) - 1] = '\0';

The return value of strchr is NULL because it cannot find the ' symbol. The symbol ' has been replaced by “ and ” in bug 774217.

Even if we revert the patch, it is still broken because the string is translatable. It can be translated to a string without any of ', ", “, ” symbol.
Comment 1 Michael Catanzaro 2016-11-12 18:10:41 UTC
Also, the search text itself is being ellipsized, that's a regression from 3.22. Both require the same changes to fix.
Comment 2 Michael Catanzaro 2016-11-12 19:14:21 UTC
The following fix has been pushed:
3e695d7 Improve handling of search the web menu item
Comment 3 Michael Catanzaro 2016-11-12 19:14:24 UTC
Created attachment 339716 [details] [review]
Improve handling of search the web menu item

We shouldn't be putting the entire context menu item label into the
GAction parameter. This is excessive and error-prone. We've started
crashing after changing the quotation characters from ' to “”, for
example. Also, some languages need to replace the quotation characters
in translations, making the previous behavior especially risky. Lastly,
extracting the search text from the ellipsized label means our search
text itself will be ellipsized, which is undesirable and not the
previous behavior prior to the GAction port.