2024-11-24 17:34 UTC

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002846NetSurf[All Projects] Generalpublic2024-02-25 21:41
ReporterPhilipRoman 
Assigned ToVincent Sanders 
SeveritycrashReproducibilityalways 
StatusclosedResolutionfixed 
Platformx86_64OSArtix LinuxOS Version
Product Version3.10 
Target Version3.11Fixed in Version3.11 
Summary0002846: Division by zero when there are images in cache but total size is zero.
DescriptionExactly what the title says.

I discovered this while trying to use man -H without psutils installed, which produced empty images. The bug is relatively harmless and almost impossible to come across in a real-life scenario but since netsurf works with untrusted input I thought it would be a good idea to patch it.
Steps To Reproducerun commands:
  touch empty.png
  echo '<img src="empty.png">' > test.html
  netsurf test.html
close browser
netsurf dumps core due to SIGFPE
Additional InformationSource file: content/handlers/image/image_cache.c
Function: image_cache_fini

op_size is zero but op_count is not:


if (op_count > 0) {
    ...
    NSLOG(netsurf, INFO,
      "Cache total/hit/miss/fail (size) ...",
      ...
      (image_cache->hit_size * 100) / op_size,
TagsNo tags attached.
Fixed in CI build #5364
Reported in CI build #
URL of problem page
Attached Files

-Relationships
+Relationships

-Notes
Vincent Sanders

~0002406

Vincent Sanders (administrator)

ensured the logging did not attempt a divide by zero in this case
Vincent Sanders

~0002431

Vincent Sanders (administrator)

Issue resolved in 3.11 release
Vincent Sanders

~0002432

Vincent Sanders (administrator)

Issue resolved in 3.11 release
+Notes

-Issue History
Date Modified Username Field Change
2022-04-04 13:13 PhilipRoman New Issue
2022-09-11 13:23 Vincent Sanders Assigned To => Vincent Sanders
2022-09-11 13:23 Vincent Sanders Status new => resolved
2022-09-11 13:23 Vincent Sanders Fixed in Version => 3.11
2022-09-11 13:23 Vincent Sanders Target Version => 3.11
2022-09-11 13:23 Vincent Sanders Fixed in CI build # => 5364
2022-09-11 13:23 Vincent Sanders Note Added: 0002406
2024-02-25 21:40 Vincent Sanders Note Added: 0002431
2024-02-25 21:41 Vincent Sanders Status resolved => closed
2024-02-25 21:41 Vincent Sanders Resolution open => fixed
2024-02-25 21:41 Vincent Sanders Note Added: 0002432
+Issue History